Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After applying resolution a file incorrectly replaced lines of code by // ... (rest of the code remains the same) #710

Open
sshveta opened this issue Feb 28, 2025 · 2 comments

Comments

@sshveta
Copy link
Collaborator

sshveta commented Feb 28, 2025

Application : coolstore .

Order.java was modified and bottom part of the file was replaces by // ... (rest of the code remains the same)

Attached screenshot .
Image

Order.java after applying resolution

Image

Logs

Sending 'analysis_engine.Analyze' request with params: {"label_selector":"(konveyor.io/target=cloud-readiness || konveyor.io/target=quarkus) || (discovery)","included_paths":["/home/sshveta/Work/applications/coolstore/src/main/java/com/redhat/coolstore/model/Order.java"],"reset_cache":false}
Response received. Summary: {"wellFormed":true,"rawIncidentCount":19,"incidentCount":19,"partialAnalysis":{"incidentsBefore":1,"incidentsAfter":1}}
Sending 'analysis_engine.Analyze' request with params: {"label_selector":"(konveyor.io/target=cloud-readiness || konveyor.io/target=quarkus) || (discovery)","included_paths":["/home/sshveta/Work/applications/coolstore/src/main/java/com/redhat/coolstore/model/Order.java"],"reset_cache":false}
Response received. Summary: {"wellFormed":true,"rawIncidentCount":19,"incidentCount":19,"partialAnalysis":{"incidentsBefore":1,"incidentsAfter":1}}
Sending 'analysis_engine.Analyze' request with params: {"label_selector":"(konveyor.io/target=cloud-readiness || konveyor.io/target=quarkus) || (discovery)","included_paths":["/home/sshveta/Work/applications/coolstore/src/main/java/com/redhat/coolstore/model/OrderItem.java"],"reset_cache":false}
Response received. Summary: {"wellFormed":true,"rawIncidentCount":19,"incidentCount":19,"partialAnalysis":{"incidentsBefore":1,"incidentsAfter":1}}
Sending 'analysis_engine.Analyze' request with params: {"label_selector":"(konveyor.io/target=cloud-readiness || konveyor.io/target=quarkus) || (discovery)","reset_cache":true}
Response received. Summary: {"wellFormed":true,"rawIncidentCount":18,"incidentCount":18,"partialAnalysis":{}}
getCodeplanAgentSolution request: {
  "file_path": "",
  "incidents": [
    {
      "uri": "file:///home/sshveta/Work/applications/coolstore/src/main/java/com/redhat/coolstore/model/Order.java",
      "message": "The way in which Hibernate determines implicit names for sequences and tables associated with identifier generation has changed in 6.0 which may affect migrating applications. \n As of 6.0, Hibernate by default creates a sequence per entity hierarchy instead of a single sequence hibernate_sequence. \n Due to this change, users that previously used `@GeneratedValue(strategy = GenerationStrategy.AUTO)` or simply `@GeneratedValue` (since `AUTO` is the default), need to ensure that the database now contains sequences for every entity, named `<entity name>_seq`. For an entity Person, a sequence person_seq is expected to exist. \n It’s best to run hbm2ddl (e.g. by temporarily setting `hbm2ddl.auto=create`) to obtain a list of DDL statements for the sequences.",
      "codeSnip": "27      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = \"order_sequence\")\n28      private long orderId;\n29  \n30      private String customerName;\n31  \n32      private String customerEmail;\n33  \n34      private double orderValue;\n35  \n36      private double retailPrice;\n37  \n38      private double discount;\n39  \n40      private double shippingFee;\n41  \n42      private double shippingDiscount;\n43  \n44      @Column(name=\"TOTAL_PRICE\")\n45  \n46      @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)\n47      @JoinColumn(name=\"ORDER_ID\")\n48      private List<OrderItem> itemList = new ArrayList<>();\n49  ",
      "lineNumber": 37,
      "variables": {
        "file": "file:///home/sshveta/Work/applications/coolstore/src/main/java/com/redhat/coolstore/model/Order.java",
        "kind": "Field",
        "name": "Id",
        "package": "com.redhat.coolstore.model"
      },
      "ruleset_name": "eap8/eap7",
      "ruleset_description": "This ruleset provides analysis of Java EE applications that need to change certain CDI-related method calls.",
      "violation_name": "hibernate-00005",
      "violation_description": "Implicit name determination for sequences and tables associated with identifier generation has changed",
      "violation_category": "potential",
      "violation_labels": [
        "konveyor.io/target=hibernate6+",
        "konveyor.io/target=hibernate",
        "konveyor.io/target=eap8+",
        "konveyor.io/target=eap",
        "konveyor.io/target=quarkus3+",
        "konveyor.io/target=quarkus",
        "konveyor.io/source",
        "hibernate"
      ],
      "violationId": "hibernate-00005"
    }
  ],
  "max_priority": 0,
  "max_depth": 1,
  "chat_token": "30baa8d9-04ce-4214-82f1-6c723244101b"
}
Sending 'analysis_engine.Analyze' request with params: {"label_selector":"(konveyor.io/target=cloud-readiness || konveyor.io/target=quarkus) || (discovery)","included_paths":["/home/sshveta/Work/applications/coolstore/src/main/java/com/redhat/coolstore/model/Order.java"],"reset_cache":false}
Response received. Summary: {"wellFormed":true,"rawIncidentCount":18,"incidentCount":18,"partialAnalysis":{"incidentsBefore":1,"incidentsAfter":1}}
@sshveta
Copy link
Collaborator Author

sshveta commented Feb 28, 2025

@sshveta sshveta changed the title After applying resolution a file was incorrectly replaced lines of code by // ... (rest of the code remains the same) After applying resolution a file incorrectly replaced lines of code by // ... (rest of the code remains the same) Feb 28, 2025
@pranavgaikwad
Copy link
Contributor

@sshveta do you happen to have traces for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants