Skip to content

Feature/jdk25 support#4363

Merged
Maheshkale447 merged 7 commits into
Releases/Betafrom
Feature/JDK25_Support
Nov 20, 2025
Merged

Feature/jdk25 support#4363
Maheshkale447 merged 7 commits into
Releases/Betafrom
Feature/JDK25_Support

Conversation

@GokulBothe99

@GokulBothe99 GokulBothe99 commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Description

Type of Change

  • Bug fix - [ ] New feature - [ ] Breaking change - [ ] Plugin update

Checklist

  • PR description clearly describes the changes
  • Target branch is correct (master for features, Releases/* for fixes)
  • Latest code from target branch merged
  • No commented/junk code included
  • No new build warnings or errors
  • All existing unit tests pass
  • New unit tests added for new functionality
  • Cross-platform compatibility verified (Windows/Linux/macOS)
  • CI/CD pipeline passes
  • Code follows project conventions (Act{Platform}{Type}, {Platform}Driver)
  • Repository objects use [IsSerializedForLocalRepository] where needed
  • Error handling uses Reporter.ToLog() pattern
  • Documentation updated for user-facing changes
  • Self-review completed and code review comments addressed

Summary by CodeRabbit

  • New Features
    • Automatic Java version detection and selection of a compatible agent jar for Java 8 vs newer.
  • Chores
    • Added a new Java agent artifact to application resources and packaging so the newer agent is available at runtime.
  • Bug Fixes / Improvements
    • Improved runtime agent selection with clearer validation and error messages when agent files or ports are missing or invalid.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds runtime Java version detection and selects between legacy GingerAgent.jar and new JavaAgent_V25.jar; updates launch/attach command assembly to use the selected jar, adds the new jar to project resources, and includes a whitespace-only UI binding reformat.

Changes

Cohort / File(s) Change Summary
Java agent selection & logic
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
Added GetJavaVersion(string) and private helpers to parse major version; introduced instance field JarFilePath and logic to choose agent jar based on Java major version (use GingerAgent.jar for ≤8, JavaAgent_V25.jar for >8); replaced hard-coded jar usage with computed JarFilePath in validation and attach/launch command assembly; minor boolean and string formatting cleanups.
Project resources
Ginger/Ginger/Ginger.csproj
Added StaticDrivers\JavaAgent_V25.jar resource entry with CopyToOutputDirectory = Always.
UI whitespace change
Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs
Whitespace-only reformat in ApplicationProcessNameTextBox.Init call; no behavioral change.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Action as ActLaunchJavaWSApplication
    participant JavaExe as java.exe
    participant AgentStore as StaticDrivers/

    User->>Action: Trigger Launch/Attach
    Action->>JavaExe: run "java -version" (GetJavaVersion)
    JavaExe-->>Action: version output
    Action->>Action: ExtractVersion / ExtractMajorVersion
    Action->>AgentStore: check for appropriate jar file (GingerAgent / JavaAgent_V25)
    AgentStore-->>Action: return selected jar path (JarFilePath)
    Action->>Action: assemble launch/attach command using JarFilePath
    Action-->>User: execute launch/attach with chosen agent
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review Java version parsing robustness across vendor/version formats (string formats like "1.8.0_241" vs "11.0.2").
  • Verify JarFilePath selection logic and existence checks around the major-version boundary.
  • Confirm all previous hard-coded references to GingerAgent.jar now use the computed path and that error messages are clear.

Possibly related PRs

Suggested reviewers

  • Maheshkale447

Poem

🐰 I sniffed the java version’s trail,
Picked the jar without fail,
Old hops or new, big or small,
I attach the right one to them all —
Hop, attach, and bounce with glee! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is entirely a template with no actual content filled in. The Description section is empty, Type of Change is unchecked, and while a checklist exists, there is no substantive information about the changes. Fill in the Description section with a brief summary of the JDK 25 support changes, select the appropriate Type of Change (likely 'New feature'), and verify checklist items are completed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Feature/jdk25 support' directly corresponds to the main change: adding JDK 25 support through dual-jar selection logic for Java version detection.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Feature/JDK25_Support

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 45a2836 and d21d806.

📒 Files selected for processing (1)
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.

Applied to files:

  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 3429
File: Ginger/Ginger/AutomatePageLib/AddActionMenu/WindowExplorer/Common/WindowExplorerPage.xaml.cs:1139-1142
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The user has updated the code by removing or addressing the commented code as suggested in the review.

Applied to files:

  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
🔇 Additional comments (6)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (6)

856-881: Version detection implementation looks correct.

The method properly:

  • Validates that java.exe exists before execution
  • Redirects StandardError where Java outputs version info
  • Uses a using statement for proper process disposal
  • Safely accesses the first line of output (Split always returns at least one element)

Minor observation: This method is declared public static but appears to be used only within this class. Consider making it private to reduce the public API surface unless external access is intentional.


883-888: LGTM!

The version extraction logic correctly handles edge cases by returning "Unknown" when quotes are not found or indices are invalid. The substring extraction is safe with the boundary checks in place.


891-913: LGTM!

The major version extraction correctly:

  • Validates input before processing (null/whitespace check)
  • Checks array bounds before accessing elements (parts.Length > 1)
  • Handles both legacy Java 1.x format and modern 9+ format
  • Uses safe parsing with fallback to 0

This implementation properly addresses the bounds checking requirement from previous reviews.


600-617: Verify jar naming aligns with supported Java version range.

The code selects JavaAgent_V25.jar for all Java versions greater than 8 (line 610):

string requiredJar = majorVersion <= 8 ? "GingerAgent.jar" : "JavaAgent_V25.jar";

This means Java 9, 10, 11, 12, ..., 24, and 25 all use JavaAgent_V25.jar. The jar name suggests it's specifically for Java 25, but the logic applies it to all modern Java versions (9+).

Please confirm:

  1. Is JavaAgent_V25.jar intended to support all Java versions from 9 through 25?
  2. If so, consider renaming to something like JavaAgent_Modern.jar or JavaAgent_JDK9Plus.jar to avoid confusion about version-specific support.
  3. If the jar only supports Java 25, update the condition to check for the specific version range.

Also note: If version detection fails (returns majorVersion = 0), the code falls back to GingerAgent.jar. If a user runs Java 17+ but version detection fails, the old jar may not work correctly.

The web search results discuss general Java agent compatibility across versions but don't provide specific information about the Ginger project's JavaAgent_V25.jar. A key finding is that Java agents compiled with a newer Java version cannot attach to older Java versions, which supports having separate jars for different version ranges.


829-836: LGTM!

The attach command correctly uses the pre-calculated JarFilePath consistently in both:

  • The agent jar path parameter (line 830)
  • The -jar command construction (line 836)

This ensures the validated jar is the same one used during attachment, maintaining correctness across the validation and execution flow.


556-634: Validation logic improvements look solid.

The refactored validation correctly:

  • Uses idiomatic negated boolean checks instead of == false comparisons
  • Integrates Java version detection seamlessly into the validation flow
  • Conditionally validates port only for Manual configuration mode (lines 621-624)
  • Provides clear error messages using string interpolation
  • Validates the selected jar file exists before attempting to attach

The overall validation flow is well-structured and maintains good separation of concerns.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml (1)

14-21: New Java Agent version UI is wired correctly; consider improving placement/text

The extra row and the xTextBoxJavaAgentJDKVersion block are structurally fine and match the code‑behind binding. Functionally this should work as intended.

Two optional tweaks to consider:

  • Place this block inside the “Attach Ginger Java Agent” section (e.g., within LaunchWithAgentArgsPnl) so the version field is visually grouped with other agent‑related settings.
  • Make the label/tooltip more explicit, e.g. “Java Agent JAR file name (e.g. GingerAgentJDK8.jar or GingerAgentJDK25.jar)” to reduce ambiguity about what users should enter.

Also applies to: 182-199

Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (2)

581-585: Redundant java.exe existence check in Java path validation

The Java bin validation currently checks java.exe twice:

if (Directory.Exists(mJavaWSEXEPath_Calc) == false ||
    File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false ||
    File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false)

The third clause is redundant. You can simplify it to improve readability without changing behavior:

-                if (Directory.Exists(mJavaWSEXEPath_Calc) == false || File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false || File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false)
+                if (!Directory.Exists(mJavaWSEXEPath_Calc) ||
+                    !File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")))

If you do intend to validate additional executables (e.g. javaws.exe for JNLP), it would be clearer to add them explicitly rather than duplicate java.exe.


1147-1166: IsInstrumentationModuleLoaded still searches for GingerAgent.jar despite versioned jars

This helper still invokes handle.exe and searches for the hard‑coded token GingerAgent.jar:

var processHandle = Process.Start(new ProcessStartInfo() { FileName = handleExePath, Arguments = String.Format(" -accepteula -p {0} GingerAgent.jar", id), UseShellExecute = false, RedirectStandardOutput = true });
string cliOut = processHandle.StandardOutput.ReadToEnd();
...
if (cliOut.Contains("GingerAgent.jar"))
{
    return true;
}

With the move to GingerAgentJDK8.jar / GingerAgentJDK25.jar and selection via JavaAgentJDKVersion, this is now inconsistent and will likely cause the method to always report “not loaded” for the new jars. That impacts logic in WaitForAppWindowTitle and other call sites that rely on this check to avoid re‑attaching.

Recommend basing the search token on the calculated agent jar name:

-                var processHandle = Process.Start(new ProcessStartInfo() { FileName = handleExePath, Arguments = String.Format(" -accepteula -p {0} GingerAgent.jar", id), UseShellExecute = false, RedirectStandardOutput = true });
+                var processHandle = Process.Start(new ProcessStartInfo()
+                {
+                    FileName = handleExePath,
+                    Arguments = string.Format(" -accepteula -p {0} {1}", id, mJavaAgentJDKVersion_calc),
+                    UseShellExecute = false,
+                    RedirectStandardOutput = true
+                });
                 string cliOut = processHandle.StandardOutput.ReadToEnd();
@@
-                if (cliOut.Contains("GingerAgent.jar"))
+                if (cliOut.Contains(mJavaAgentJDKVersion_calc))
                 {
                     return true;
                 }

This keeps existing behavior but makes it compatible with the new JDK‑specific agent jars and the JavaAgentJDKVersion setting.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 225a60d and 1e912d9.

⛔ Files ignored due to path filters (12)
  • Ginger/Ginger/GingerAgentStarter.xml is excluded by !**/*.xml
  • Ginger/Ginger/StaticDrivers/GingerAgent.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/Ginger/StaticDrivers/GingerAgentJDK25.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/Ginger/StaticDrivers/GingerAgentJDK8.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/Ginger/StaticDrivers/GingerAgentStarter.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerAgentBuild.xml is excluded by !**/*.xml
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent.docx is excluded by !**/*.docx, !**/*.docx
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/GingerAgent.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/GingerAgentStarter.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/build.xml is excluded by !**/*.xml
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/jsoup.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/xsoup.jar is excluded by !**/*.jar, !**/*.jar
📒 Files selected for processing (32)
  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml (2 hunks)
  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs (1 hunks)
  • Ginger/Ginger/Ginger.csproj (1 hunks)
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (6 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.classpath (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.externalToolBuilders/CreateJavaAgentJar.launch (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.project (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.settings/org.eclipse.jdt.core.prefs (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/GingerAgentJar.jardesc (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/GingerjarPreparation.bat (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/MANIFEST.MF (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/ASCFPack/ASCFHelper.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/BrowserHelper.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/EditorHelper.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/FormsDumpInfo.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerAgent.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerAgentFrame.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerAgentStarterFrame.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerJavaSocketServer.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/IXPath.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/PayLoad.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/Recorder.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/SwingHelper.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/Utils.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/WaitForIdle.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/WindowMonitor.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/XPathHelper.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/BasicSwingApp.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/BasicSwingComponents.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/GingerAgentTestApp.java (0 hunks)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/JEditorPaneExample.java (0 hunks)
  • Ginger/GingerCore/GingerCore.csproj (0 hunks)
💤 Files with no reviewable changes (28)
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/JEditorPaneExample.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.project
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerAgentStarterFrame.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.settings/org.eclipse.jdt.core.prefs
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/Utils.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/WindowMonitor.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/GingerjarPreparation.bat
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/XPathHelper.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/GingerAgentTestApp.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/WaitForIdle.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerAgentFrame.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/BasicSwingApp.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.classpath
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/GingerAgentJar.jardesc
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/IXPath.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerJavaSocketServer.java
  • Ginger/GingerCore/GingerCore.csproj
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/.externalToolBuilders/CreateJavaAgentJar.launch
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/PayLoad.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/FormsDumpInfo.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/BrowserHelper.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/test/com/amdocs/ginger/BasicSwingComponents.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/Recorder.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/ASCFPack/ASCFHelper.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/EditorHelper.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/SwingHelper.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/agent/com/amdocs/ginger/GingerAgent.java
  • Ginger/GingerCore/Drivers/JavaDriverLib/GingerJavaAgent/MANIFEST.MF
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/Ginger/Ginger.csproj
📚 Learning: 2025-07-16T14:42:32.229Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 4254
File: Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/LearnWizard/POMLearnConfigWizardPage.xaml.cs:70-73
Timestamp: 2025-07-16T14:42:32.229Z
Learning: In Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/LearnWizard/POMLearnConfigWizardPage.xaml.cs, prashelke prefers to keep the current `!WorkSpace.Instance.BetaFeatures.ShowPOMForAI` logic for binding and showing AI POM controls, rather than changing it to positive logic.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml
📚 Learning: 2025-08-28T09:27:18.847Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4286
File: Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs:556-571
Timestamp: 2025-08-28T09:27:18.847Z
Learning: In Ginger's WebAgentConfigEditPage.xaml.cs ZAP configuration, when ZAP Security Testing is enabled, the manual proxy UI should remain enabled/accessible even though ZAP will override the proxy settings in the background. This allows users to see and modify their proxy configurations for transparency and future use when ZAP is disabled. Confirmed by AmanPrasad43 in PR #4286.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 3429
File: Ginger/Ginger/AutomatePageLib/AddActionMenu/WindowExplorer/Common/WindowExplorerPage.xaml.cs:1123-1126
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The user has removed an unnecessary empty line at 1123 in `WindowExplorerPage.xaml.cs` for better code compactness.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml
🧬 Code graph analysis (1)
Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs (1)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (2)
  • ActLaunchJavaWSApplication (40-1202)
  • Fields (82-106)
🔇 Additional comments (1)
Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs (1)

56-84: Binding for xTextBoxJavaAgentJDKVersion looks consistent

The new Init call follows the existing UCValueExpression binding pattern (Context + action + Fields.JavaAgentJDKVersion) and should correctly wire the new property into the edit page.

Comment thread Ginger/Ginger/Ginger.csproj Outdated
Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (1)

581-585: Redundant File.Exists("java.exe") check in Java path validation

The condition:

if (Directory.Exists(mJavaWSEXEPath_Calc) == false ||
    File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false ||
    File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false)

checks for java.exe twice, making the third operand redundant.

You can simplify (and clarify intent) as:

-                if (Directory.Exists(mJavaWSEXEPath_Calc) == false || File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false || File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")) == false)
+                if (!Directory.Exists(mJavaWSEXEPath_Calc) ||
+                    !File.Exists(Path.Combine(mJavaWSEXEPath_Calc, "java.exe")))

or, if you meant to also validate javaws.exe, introduce that explicitly instead of duplicating the same check.

♻️ Duplicate comments (2)
Ginger/Ginger/Ginger.csproj (1)

2671-2673: Fix indentation inconsistency: use spaces instead of tabs.

Lines 2671-2673 use tabs for indentation while all surrounding <None Update> entries (lines 2668–2670, 2674–2676) use spaces. Replace tabs with spaces to match the project's formatting conventions.

     <None Update="sikulirestapi-1.0.jar">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
-	  <None Update="StaticDrivers\JavaAgent_V25.jar">
-		  <CopyToOutputDirectory>Always</CopyToOutputDirectory>
-	  </None>
+    <None Update="StaticDrivers\JavaAgent_V25.jar">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <None Update="StaticDrivers\GingerAgentStarter.jar">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </None>
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (1)

619-621: Agent folder validation may be stricter than necessary vs dynamic jar selection

Validation currently requires both jars to exist:

if (Directory.Exists(mJavaAgentPath_Calc) == false ||
    File.Exists(Path.Combine(mJavaAgentPath_Calc, "GingerAgent.jar")) == false ||
    File.Exists(Path.Combine(mJavaAgentPath_Calc, "JavaAgent_V25.jar")) == false)

while GetJavaAgentJar at runtime chooses one jar based on the detected Java major version:

if (majorVersion <= 8)
    return Path.Combine(agentPath, "GingerAgent.jar");
else
    return Path.Combine(agentPath, "JavaAgent_V25.jar");

If deployments are allowed to ship only the jar they actually need (e.g., Java 17+ only with just JavaAgent_V25.jar), this validation will block otherwise valid configurations.

Consider either:

  • Intentionally documenting and enforcing “both jars must be present”, or
  • Relaxing validation to check only the jar that will actually be used (e.g., derive the expected jar via GetJavaAgentJar or a cheaper equivalent and validate that path).

Also applies to: 898-913

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e912d9 and 5270db2.

⛔ Files ignored due to path filters (2)
  • Ginger/Ginger/StaticDrivers/GingerAgent.jar is excluded by !**/*.jar, !**/*.jar
  • Ginger/Ginger/StaticDrivers/JavaAgent_V25.jar is excluded by !**/*.jar, !**/*.jar
📒 Files selected for processing (2)
  • Ginger/Ginger/Ginger.csproj (1 hunks)
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (7 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: Maheshkale447
Repo: Ginger-Automation/Ginger PR: 3637
File: Ginger/GingerCoreNET/Application Models/Execution/POM/POMExecutionUtils.cs:226-234
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The `LastUpdatedTime` in the `POMExecutionUtils.cs` file of the Ginger project is always in the correct DateTime format, as confirmed by the user. This information is crucial for avoiding unnecessary error handling suggestions in future reviews.

Applied to files:

  • Ginger/Ginger/Ginger.csproj
📚 Learning: 2025-01-21T11:43:12.379Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 4067
File: Ginger/GingerCoreCommon/Repository/SolutionRepository.cs:55-55
Timestamp: 2025-01-21T11:43:12.379Z
Learning: In Ginger's SolutionRepository, the path @"ExecutionResults\GingerExecutionResults.db" needs to be explicitly excluded in mSolutionPathsToAvoid list, even though its parent directory @"ExecutionResults\" is also excluded. This specific file exclusion serves a distinct purpose and should not be considered redundant.

Applied to files:

  • Ginger/Ginger/Ginger.csproj
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.

Applied to files:

  • Ginger/Ginger/Ginger.csproj
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs

Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (1)

1206-1226: IsInstrumentationModuleLoaded only detects GingerAgent.jar, not JavaAgent_V25.jar.

With the new dynamic jar selection, PerformAttachGingerAgent may attach JavaAgent_V25.jar for Java 9+ versions (line 816), but IsInstrumentationModuleLoaded still hardcodes GingerAgent.jar in both:

  • The handle.exe arguments (line 1218)
  • The output detection check (line 1223)

This means for Java 9+ processes using JavaAgent_V25.jar:

  • The method always returns false
  • The 30-second post-attach polling loop (lines 452-458) never observes the agent as loaded
  • Re-attach protection based on this method fails

Update the detection to handle both jar names:

-var processHandle = Process.Start(new ProcessStartInfo() { FileName = handleExePath, Arguments = String.Format(" -accepteula -p {0} GingerAgent.jar", id), UseShellExecute = false, RedirectStandardOutput = true });
+var processHandle = Process.Start(new ProcessStartInfo() { FileName = handleExePath, Arguments = String.Format(" -accepteula -p {0}", id), UseShellExecute = false, RedirectStandardOutput = true });
 string cliOut = processHandle.StandardOutput.ReadToEnd();
 processHandle.WaitForExit();
 processHandle.Close();
 
-if (cliOut.Contains("GingerAgent.jar"))
+if (cliOut.Contains("GingerAgent.jar") || cliOut.Contains("JavaAgent_V25.jar"))
 {
     return true;
 }

Note: Removing the jar name from handle.exe arguments makes it search all handles for the process, then checking output for either jar name ensures detection works for both agents.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5270db2 and 19c9308.

📒 Files selected for processing (2)
  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs (1 hunks)
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (6 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-07-16T14:42:32.229Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 4254
File: Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/LearnWizard/POMLearnConfigWizardPage.xaml.cs:70-73
Timestamp: 2025-07-16T14:42:32.229Z
Learning: In Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/LearnWizard/POMLearnConfigWizardPage.xaml.cs, prashelke prefers to keep the current `!WorkSpace.Instance.BetaFeatures.ShowPOMForAI` logic for binding and showing AI POM controls, rather than changing it to positive logic.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
📚 Learning: 2025-06-16T10:36:01.993Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 4228
File: Ginger/Ginger/Actions/ActionEditPages/ActMobileDeviceEditPage.xaml.cs:83-84
Timestamp: 2025-06-16T10:36:01.993Z
Learning: For the `UnLockType` property in `Ginger/Ginger/Actions/ActionEditPages/ActMobileDeviceEditPage.xaml.cs`, the current naming convention with capital 'L' in the middle should be maintained per project preferences.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs
🧬 Code graph analysis (1)
Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs (1)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (2)
  • ActLaunchJavaWSApplication (40-1260)
  • Fields (82-105)
🔇 Additional comments (2)
Ginger/Ginger/Actions/ActionEditPages/ActLaunchJavaWSApplicationEditPage.xaml.cs (1)

79-79: LGTM - Whitespace-only change.

This change only affects trailing whitespace with no functional impact.

Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (1)

600-602: Dual-jar validation is appropriately updated.

The validation now correctly checks for both GingerAgent.jar and JavaAgent_V25.jar, and the error message accurately references both files. While this requires both jars to be present (stricter than runtime needs since only one is used per Java version), it ensures the deployment bundle is complete.

Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (1)

1210-1230: Fix IsInstrumentationModuleLoaded to detect both agent jar names.

The method at lines 1222 and 1227 hardcodes "GingerAgent.jar" but the codebase deploys two different agents based on Java version:

  • GingerAgent.jar for Java 8 and lower (line 890)
  • JavaAgent_V25.jar for Java 9+ (line 894)

For Java 9+ processes with JavaAgent_V25.jar attached, the method will always return false because handle.exe is called with "GingerAgent.jar" and the output check looks for "GingerAgent.jar". This causes:

  • The 30-second polling loop (lines 452-458) never breaks early, timing out instead
  • Re-attach protection fails, potentially leading to duplicate attach attempts
  • Incorrect retry/validation behavior for Java 9+ applications

Solution: Modify IsInstrumentationModuleLoaded to check for both jar names in the output:

// Line 1222: pass both jar names or search for either
// Line 1227: check if output contains EITHER jar name
if (cliOut.Contains("GingerAgent.jar") || cliOut.Contains("JavaAgent_V25.jar"))
{
    return true;
}

Alternatively, query the process modules directly without relying on the hardcoded jar name.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 19c9308 and d5b07a8.

📒 Files selected for processing (1)
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.

Applied to files:

  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 3429
File: Ginger/Ginger/AutomatePageLib/AddActionMenu/WindowExplorer/Common/WindowExplorerPage.xaml.cs:1139-1142
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The user has updated the code by removing or addressing the commented code as suggested in the review.

Applied to files:

  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
🔇 Additional comments (3)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (3)

816-827: Dynamic Java agent jar selection correctly implemented.

The code properly invokes GetJavaAgentJar to select the appropriate agent jar based on Java version detection and consistently uses the result in both command parameters and the -jar command. This enables support for both Java 8 (GingerAgent.jar) and Java 9+ (JavaAgent_V25.jar).


847-896: Java version detection and jar selection logic is well-implemented.

The implementation correctly:

  • Executes java -version and reads from StandardError (where Java outputs version info)
  • Handles the case where java.exe is not found with a clear exception
  • Parses version strings and extracts the version number safely
  • Selects the appropriate agent jar based on major version (≤8 uses GingerAgent.jar, >8 uses JavaAgent_V25.jar)
  • Provides safe fallbacks (file not found → exception, parse failure → "Unknown" → major version 0 → GingerAgent.jar)

898-920: Version parsing logic correctly handles both legacy and modern Java version formats.

The implementation properly:

  • Guards against null/whitespace input (returns 0 as fallback)
  • Handles legacy Java 1.x format (e.g., "1.8.0_171") by checking parts[0] == "1" && parts.Length > 1
  • Handles modern Java 9+ format (e.g., "17.0.2") by parsing the first part
  • Uses int.TryParse for safe parsing without exceptions
  • Has appropriate safeguards against IndexOutOfRangeException (the length check at line 908 prevents accessing parts[1] when it doesn't exist)

The fallback of majorVersion = 0 is sensible as it causes GetJavaAgentJar to select GingerAgent.jar, which is the safer choice for unparseable versions.

Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (1)

856-881: Consider adding defensive null/empty checks for process output.

While the current implementation handles most error cases by returning "Unknown" and falling back to version 0 (which selects GingerAgent.jar), adding explicit checks for empty output would make the code more robust and easier to debug.

 public static string GetJavaVersion(string javaExePath)
 {
     if (!File.Exists(javaExePath))
     {
         throw new FileNotFoundException("java.exe not found at the specified path.", javaExePath);
     }
 
     ProcessStartInfo psi = new ProcessStartInfo
     {
         FileName = javaExePath,
         Arguments = "-version",
         RedirectStandardError = true,
         UseShellExecute = false,
         CreateNoWindow = true
     };
 
     using (Process process = Process.Start(psi))
     {
         string output = process.StandardError.ReadToEnd();
         process.WaitForExit();
 
+        if (string.IsNullOrWhiteSpace(output))
+        {
+            Reporter.ToLog(eLogLevel.WARN, "java -version returned empty output");
+            return "Unknown";
+        }
+        
         // First line usually: java version "17.0.2"
-        string versionLine = output.Split('\n')[0];
+        string[] lines = output.Split('\n');
+        string versionLine = lines.Length > 0 ? lines[0] : string.Empty;
         return ExtractVersion(versionLine);
     }
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5b07a8 and 45a2836.

📒 Files selected for processing (1)
  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (5 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
Repo: Ginger-Automation/Ginger PR: 4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.

Applied to files:

  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
Repo: Ginger-Automation/Ginger PR: 3429
File: Ginger/Ginger/AutomatePageLib/AddActionMenu/WindowExplorer/Common/WindowExplorerPage.xaml.cs:1139-1142
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The user has updated the code by removing or addressing the commented code as suggested in the review.

Applied to files:

  • Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
🔇 Additional comments (2)
Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs (2)

600-624: Verify JAR naming convention and version support scope.

The code selects JavaAgent_V25.jar for all Java versions greater than 8 (line 610), but the jar name suggests it's specifically for JDK 25. If this jar is intended to support JDK 9 through 25+, the current logic is correct. However, if separate jars are needed for different version ranges (e.g., JDK 9-16, JDK 17-24, JDK 25+), this logic may need adjustment.

Please confirm:

  1. Is JavaAgent_V25.jar intended to support all JDK versions from 9 onwards?
  2. Are there plans to support additional version-specific jars in the future?

If version-specific jars are needed, consider using a more flexible selection mechanism:

string requiredJar = majorVersion switch
{
    <= 8 => "GingerAgent.jar",
    >= 9 and <= 16 => "JavaAgent_V16.jar",  // If needed
    >= 17 and <= 24 => "JavaAgent_V24.jar", // If needed
    >= 25 => "JavaAgent_V25.jar",
    _ => "GingerAgent.jar" // fallback
};

829-836: Dynamic jar selection correctly integrated into attach flow.

The code properly uses JarFilePath for both the agent jar path parameter and the -jar command, ensuring the dynamically selected jar is consistently used throughout the attach operation.

Note: This implementation depends on fixing the thread-safety issue with the static JarFilePath field (see comment on lines 636-637).

Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActLaunchJavaWSApplication.cs
@Maheshkale447
Maheshkale447 merged commit 2f575ce into Releases/Beta Nov 20, 2025
4 of 5 checks passed
@Maheshkale447
Maheshkale447 deleted the Feature/JDK25_Support branch November 20, 2025 12:53
@coderabbitai coderabbitai Bot mentioned this pull request Nov 21, 2025
15 tasks
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

Successfully merging this pull request may close these issues.

2 participants