Add loop and if-statements detection to decompilation, also handle basic try-catch and synchronized blocks.
Added
StringBuilderIndentprovides the same API asStringBuilder(unfortunately we can't extend StringBuilder because it is final) and implementsIndentso that this class can be used to easily build source code stringssrc/twg2/jbcm/toSource/structureswith state handlers for inserting more complex structures such as loops and try-catch statements into source code during opcode iteration
Changed
twg2.jbcm.classFormat.attributes.CodetoClassString()renamedtoClassCodeString()CpIndexChangeris now stateful and contains the old and new index and uses a proper visitor pattern to handle changing indexesIndentchanged from a class to an interface with a public staticImplsubclassIterateCoderenamedCodeIteratorRuntimeReloadMainrefactored, more complex threaded loading and invocation of methods from updated class files, some code moved to new classestwg2.jbcm.runtime.ClassLoadersandFileUtilitytwg2.jbcm.runtimeLoadingpackage renamedtwg2.jbcm.runtimeCodeFlowcontains algorithms for detecting loops and if-statements in byte codeDataCountingInputStreamadded and used inClassFilewhen parsing a class to improve debug and error message with exact byte index locations- Several new unit/integration tests added,
CompileTestrenamedCompileJava - Fixed compiling code during runtime to support class names with arbitrary package paths, required extensive changes to
CompileSource JumpConditionInforewritten to support representing loop and nested if-statement conditionsTypeUtility.classNameFieldDescriptor()renamedtoBinaryClassName()