The alternative method using StackWalker (since Java 9):
public static Class<?> getCallerClass(int n) {
try {
List<StackFrame> stack = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).walk(s -> s.limit(n).collect(Collectors.toList()));
StackFrame stackFrame = stack.get(stack.size()-1);
return stackFrame.getDeclaringClass();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Compile and replace the class file ("com.ti.dvt.util.install.Install") in ./ccs1040/ccs/ccs_base/dvt_4.1.0.202105121547/bin/com.ti.util_4.1.0.202105121547.jar
Use standalone Nashron from OpenJDK. Create a folder named "nashron" in the same folder with "ccstudio.exe" and "eclipse.exe", unzip the jars into the newly created folder. Edit "./ccs1040/ccs/eclipse/plugins/com.ti.dvt.control.engine_4.1.0.202105121547/META-INF/MANIFEST.MF"
:
Bundle-ClassPath: .,
com.ti.dvt.control.engine.jar,
external:$eclipse.launcher$/../nashorn/asm-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-analysis-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-commons-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-tree-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/asm-util-7.3.1.jar,
external:$eclipse.launcher$/../nashorn/nashorn-core-15.3.jar
The correct alternative should be org.eclipse.core.runtime.Platform
. For now, copy org/eclipse.cdt/utils/Platform.class
from the legacy jar into the new jar fixes the problem.
Copy Assert.class
and its sub class(es) from the legacy jar org.eclipse.jface_xxx.jar
to the new jar.
Should use org.eclipse.core.text.StringMatcher
, but here we just copy StringMatcher
and its subclasses into the new jar.