Created
February 28, 2025 15:26
-
-
Save jwmatthews/e5fff6a2432931cd4c90431a10ba359e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Message-0 | |
================================ System Message ================================ | |
You are a senior engineer with extensive experience in developing enterprise Java applications. | |
You are helping migrate old Java applications to a newer technology. | |
A junior engineer has updated a java file in an application to migrate it to a newer technology. | |
Use your best judgement to analyze the input data and review the changes. | |
Message-1 | |
================================ Human Message ================================= | |
You will be given a list of migration issues found in an old java file in JSON format. | |
Instead of the java files themselves, you will be given a difference between old file and the new file in JSON format. | |
The difference is constructed by comparing ASTs of the two files. The JSON keys are self-explanatory. | |
You will analyze the differences expressed in JSON format to create a mental picture of the old source code and the new. | |
You will compare the analyzed data with the list of issues and identify which of the issues are not fixed. | |
Issues often describe the expected change that needs to happen. You will use your best judgement to identify whether the issue is fixed as described. | |
You will also look for any new changes that were not originally mentioned in the issues. | |
You will also spot any changes that suggest a change in the original functionality. | |
If you find an issue that's not fixed, briefly describe why you think the issue is not fixed in 1-2 lines. If you find unnecessary changes, point those out too. | |
Be precise in pointing out issues that are not fixed. | |
If you find the changes satisfactory, clearly output the word "TERMINATE" in your response. | |
## Issues identified in the input file | |
{ | |
"issues": [ | |
"Enterprise Java Beans (EJBs) are not supported in Quarkus. CDI must be used.\n Please replace the `@MessageDriven` annotation with a CDI scope annotation like `@ApplicationScoped`." | |
] | |
} | |
## Differences in ASTs of both files | |
{ | |
"imports": { | |
"old": [ | |
"javax.ejb.ActivationConfigProperty", | |
"javax.jms.JMSException", | |
"javax.jms.MessageListener", | |
"javax.jms.TextMessage", | |
"com.redhat.coolstore.utils.Transformers", | |
"javax.jms.Message", | |
"javax.ejb.MessageDriven", | |
"com.redhat.coolstore.model.Order", | |
"jakarta.inject.Inject" | |
], | |
"new": [ | |
"javax.enterprise.event.Observes", | |
"io.qu", | |
"javax.jms.TextMessage", | |
"io.quarkus.runtime.annotations.InjectableBean", | |
"javax.jms.Message", | |
"javax.jms.MessageListener", | |
"javax.jms.JMSContext", | |
"javax.enterprise.context.ApplicationScoped", | |
"io.quarkus.arc.BeanContainer", | |
"io.quarkus.runtime.StartupEvent", | |
"org.jboss.logging.Logger", | |
"javax.jms.JMSException", | |
"com.redhat.coolstore.utils.Transformers", | |
"io.quarkus.arc.Arc", | |
"io.quarkus.runtime.annotations.InjectableBeanDefinitionBuilder", | |
"io.quarkus.runtime.annotations.Injectable", | |
"io.quarkus.runtime.annotations.InjectableBeanDefinition", | |
"javax.inject.Inject", | |
"javax.jms.Topic", | |
"io.quarkus.runtime.QuarkusApplication", | |
"io.quarkus.runtime.annotations.QuarkusMain", | |
"io.quarkus.runtime.annotations.QuarkusApplication", | |
"javax.jms.JMSProducer", | |
"com.redhat.coolstore.model.Order" | |
] | |
}, | |
"classes": { | |
"removed": [ | |
{ | |
"name": "OrderServiceMDB", | |
"interfaces": [ | |
"implements", | |
"MessageListener" | |
], | |
"annotations": [ | |
{ | |
"name": "MessageDriven", | |
"parameters": "(name = \"OrderServiceMDB\", activationConfig = {\n\t@ActivationConfigProperty(propertyName = \"destinationLookup\", propertyValue = \"topic/orders\"),\n\t@ActivationConfigProperty(propertyName = \"destinationType\", propertyValue = \"javax.jms.Topic\"),\n\t@ActivationConfigProperty(propertyName = \"acknowledgeMode\", propertyValue = \"Auto-acknowledge\")})" | |
} | |
], | |
"fields": { | |
"-171367544915111761": { | |
"name": "orderService", | |
"type": "OrderService", | |
"annotations": [ | |
{ | |
"name": "Inject" | |
} | |
] | |
}, | |
"-2184062520860118339": { | |
"name": "catalogService", | |
"type": "CatalogService", | |
"annotations": [ | |
{ | |
"name": "Inject" | |
} | |
] | |
} | |
}, | |
"methods": { | |
"-2492540718278826123": { | |
"name": "onMessage", | |
"parameters": "(Message rcvMessage)", | |
"body": "{\n\t\tSystem.out.println(\"Message recd !\");\n\t\tTextMessage msg = null;\n\t\ttry {\n\t\t\t\tif (rcvMessage instanceof TextMessage) {\n\t\t\t\t\t\tmsg = (TextMessage) rcvMessage;\n\t\t\t\t\t\tString orderStr = msg.getBody(String.class);\n\t\t\t\t\t\tSystem.out.println(\"Received order: \" + orderStr);\n\t\t\t\t\t\tOrder order = Transformers.jsonToOrder(orderStr);\n\t\t\t\t\t\tSystem.out.println(\"Order object is \" + order);\n\t\t\t\t\t\torderService.save(order);\n\t\t\t\t\t\torder.getItemList().forEach(orderItem -> {\n\t\t\t\t\t\t\tcatalogService.updateInventoryItems(orderItem.getProductId(), orderItem.getQuantity());\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t} catch (JMSException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", | |
"annotations": [ | |
{ | |
"name": "Override" | |
} | |
] | |
} | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment