{"id":570,"date":"2026-05-28T09:08:00","date_gmt":"2026-05-28T09:08:00","guid":{"rendered":"https:\/\/prosasecurity.com\/?p=570"},"modified":"2026-06-19T09:13:02","modified_gmt":"2026-06-19T09:13:02","slug":"using-artificial-intelligence-to-port-precious-legacy-java-code-the-prosa-story","status":"publish","type":"post","link":"https:\/\/prosasecurity.com\/index.php\/2026\/05\/28\/using-artificial-intelligence-to-port-precious-legacy-java-code-the-prosa-story\/","title":{"rendered":"Using Artificial Intelligence to port precious legacy Java code &#8211; the PROSA story"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"720\" src=\"https:\/\/prosasecurity.com\/wp-content\/uploads\/2026\/06\/1779985367091-1024x720.png\" alt=\" The old legacy code running in a controlled environment \" class=\"wp-image-571\"\/><figcaption class=\"wp-element-caption\">The old legacy code running in a controlled environment<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We in PROSA have not used Artificial Intelligence in the PROSA company seriously prior \u2013 on the code\/design-level. But bicycling home from work, the excellent mathematician and programmer Per Christian Moan, stopped me \u2013 and strongly advocated me to test the new LLMs Claude or Codex. He did not do this once, but many times, almost every time we meet on the bicycle on the way home. Of course, I knew that the PROSA tool and its implementation could benefit \u2013 potentially enormously from the application of AI-based code-support tools like Claude or Codex. One urgent problem we had to solve was the porting issue. We had decided ten years ago to build the User interaction framework based on the open Eclipse framework. The choice was deliberate and at the time &nbsp;a large collection of functionality, library and built-in features that we could deploy. The downside is that Eclipse is a big castle of dependencies \u2013 and development, installation and configuration often turn out to be time-consuming, forcing the developer to more of a librarian than a creator and realizer of ideas. To concretize my point, the numbers speak for themselves: The PROSA-Eclipse bundle contains 2081 files and 319 folders. A tiny fraction of this huge set of files are programs that we have created \u2013 most of the files are configuration-files automatically generated or required by the Eclipse framework.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We had this implementation of the PROSA tool, that we did not have resources to maintain, due to a lot of external consultancy work and poor funding&nbsp; to establish a stable development and maintenance organization for years. The code was precious and some of it was very advanced \u2013 but hard to understand, even for the lead programmers. The mathematical logician Ivar Rummelhoff, who also happen to be a very good programmer \u2013 had made a mirror implementation of my belief-algorithm in the backend, implemented in the term-rewriting framework Maude. The experienced functional programmer Thor Kristoffersen had designed a way to build a views framework, carefully and thoroughly designed. The installation procedure for the tool \u2013 back in 2018 was extremely complicated. AI-frameworks for code-support seemed to be the exact tool for lifting out of despair: We were running into versioning problems with Java (we ran Java 8), outdated version of the GUI-framework Java FX, the version of the grammar framework Eclipse Xtext malfunctioned \u2013 and Eclipse not providing a safe space for experimenting and upgrading. We tried once to upgrade to newer versions in 2020 \u2013 but had to give up, the problems occurring during these sessions multiplied \u2013 and we ran out of money. Then AI entered the scene. Mayve Per Christian was right? Maybe we could us a coding framework like Claude or Codex could do the job?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My Colleague Erik Vasaasen was already using Codex for Vibe-coding \u2013 with great success, and he also pushed for us \u2013 \u201cjumping into the realm of AI-coding\u201d. Erik installed Codex on a ten-year-old laptop in my office. We did a few experiments on vibe-coding a graph in the tool, but the result was not accurate. A couple of conversations with several with the research scientists in SAND, including Ariel Almendral was encouraging. \u201cJust start this and learn on the fly!\u201d Well we started. Planning and describing constraints and restriction on the work was the first task. We used Codex to assist us in specifying the plan for porting. We specified very strict requirements on a porting that should not include vibe-alike free coding, out-of-control or impossible-to-understand automatically generated code, and fortunately \u2013 Codex agreed\ud83d\ude0a.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The language translating capabilities of the AI-engines are currently good. In addition to the code-generation-part, the infrastructure part was equally challenging. Could codex get around this monstrous infrastructure? Lots of configuration and dependencies \u2013 built into the Eclipse framework? Fortunately it could. Codex has probably been trained on Eclipse in advance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Asking Codex for advices on how to proceed was also important. The first task was to point&nbsp; to the source code tree and make Codex analyse the code. Along the journey we also gave Codex some documentation we had \u2013 figures we had made. This was probably useful to the analysis done afterwards. We asked the tool for performing an automated documentation of the PROSA-specific code \u2013 and Codex proposed to introduce three layers:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Layer 1: The PROSA core \u2013 consisting of the language definitions and analysis engine, including a lot of responsibilities: parsing ROSA source, validation and resolving names, discover interactions, emit Maude input, parse Maude output, build sequence diagram data and export stable JSON DTOs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Layer 2: The PROSA eclipse \u2013 consisting of ROSA-editor integration, validation markers, outline and navigation, commands such as analyses, sequence diagrams, protection diagrams (graphs) and tables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROSA web-application, with the responsibilities of REST endpoints, a browser editor, D3 sequence diagram rendering, D3 protection graph rendering and finally debug and diagnostic panels.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After working on this path for several days \u2013 we found several inconvenient and rather destructive paths were followed \u2013 and made some significant revisions. I discovered that Codex had started to change the original PROSA codebase \u2013 the legacy code base. That was not intended \u2013 from my side, and a couple of days were devoted to roll-back to the original code. Erik Vasaasen dropped by at the work site of PROSA and spent quite lot of &nbsp;hours together with me in the final phase of reconstructing the old legacy code into its original form. Together we managed to get the entire GUI front-end up and working into its 2026-edition. The result was fantastic! (see the picture below). We postponed the strict web-porting for a while and focused on the core porting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"816\" src=\"https:\/\/prosasecurity.com\/wp-content\/uploads\/2026\/06\/1779985645243-1024x816.png\" alt=\"Modern ported version of the PROSA tool, running on Java 21, Eclipse 2026 version, a new version of Java FX.\" class=\"wp-image-572\"\/><figcaption class=\"wp-element-caption\">Modern ported version of the PROSA tool, running on Java 21, Eclipse 2026 version, a new version of Java FX.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So what is next? To be honest I do not know yet. There are so many possibilities for further experimentation and adding of new functionality \u2013 using the latest AI-based code-generators. \u00a0We spent one and a half week to solve the porting problem. In 2020 we tried to do something similar \u2013 but had to leave it \u2013 unsolved. It costed us 12 000 Euros \u2013 and we were nowhere close to have any success. Guesswork of course, but performing the porting without any AI-support would have costed at least 100 000 Euros. And we had made it in just one-and-a-half week!<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We in PROSA have not used Artificial Intelligence in the PROSA company seriously prior \u2013 on the code\/design-level. But bicycling home from work, the excellent mathematician and programmer Per Christian Moan, stopped me \u2013 and strongly advocated me to test the new LLMs Claude or Codex. He did not do this once, but many times, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-570","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/comments?post=570"}],"version-history":[{"count":1,"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/posts\/570\/revisions"}],"predecessor-version":[{"id":573,"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/posts\/570\/revisions\/573"}],"wp:attachment":[{"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/media?parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/categories?post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prosasecurity.com\/index.php\/wp-json\/wp\/v2\/tags?post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}