Skip to content

Conversation

@vogella
Copy link
Member

@vogella vogella commented Dec 9, 2025

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @vogella, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the Maven build process by externalizing Tycho version management and other build parameters into a dedicated configuration file. The primary user-facing enhancement is a significant upgrade to the cyclic dependency detection feature, which now provides interactive and visually rich ASCII art representations of detected cycles within the Eclipse Console, moving beyond basic dialog messages. This change improves the clarity and utility of the dependency analysis for developers.

Highlights

  • Maven Build Configuration: Centralized Maven build properties, including the Tycho version, into a new ".mvn/maven.config" file for easier management and consistent builds.
  • Enhanced Cyclic Dependency Visualization: Improved the cyclic dependency detection tool to output detailed ASCII art visualizations of dependency cycles directly into the Eclipse Console, offering a clearer understanding than a simple dialog.
  • Eclipse Console Integration: Integrated the Eclipse Console view to display the cyclic dependency analysis results, including new helper methods to manage and show the console programmatically.
  • Update Site Inclusion: Added the "com.vogella.ide.debugtools" plugin to the update site, making it available for installation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@vogella
Copy link
Member Author

vogella commented Dec 9, 2025

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly enhances the cyclic dependency detection feature by redirecting detailed cycle information, including ASCII art representations, to an Eclipse console instead of a single dialog, with a simplified dialog now prompting users to check the console. This involved adding new UI console dependencies and implementing console management and ASCII art generation logic. Additionally, the build configuration was updated to externalize the Tycho version. However, the review comments consistently point out the removal of numerous Javadoc, inline comments, and blank lines within the DetectCyclicDependenciesHandler.java file, especially in the complex cycle detection algorithms, arguing that these removals negatively impact code clarity, readability, and maintainability.

I am having trouble creating individual review comments. Click here to see my feedback.

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (180)

medium

The Javadoc comment for CyclicDependencyDetector was removed. This comment provided a useful high-level description of the class's purpose, which is important for understanding its role in detecting cyclic dependencies. Reinstating it would improve code clarity and maintainability.

    /**
     * Core logic for detecting cyclic dependencies
     */
    private static class CyclicDependencyDetector {

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (190)

medium

The inline comment clarifying the possible values for the type field ("Require-Bundle" or "Import-Package: package.name") was removed. This comment was valuable for understanding the data stored in this field. Re-adding it would enhance code readability.

            String type; // "Require-Bundle" or "Import-Package: package.name"

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (214-216)

medium

The blank lines before and after buildDependencyGraph() and findAllCycles() were removed. These blank lines helped to visually separate the distinct steps of the cycle detection process, improving readability. Restoring them would make the method's flow clearer.

            buildDependencyGraph();
            findAllCycles();
            
            return cycles;

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (222-223)

medium

The comment // First pass: collect all workspace bundles and their exported packages was removed. This comment provided crucial context for the initial phase of building the dependency graph, explaining the purpose of collecting package information. Reinstating it would significantly improve the understanding of this method.

            // First pass: collect all workspace bundles and their exported packages
            Map<String, String> packageToBundle = new HashMap<>();
            Map<String, IPluginModelBase> workspaceModels = new HashMap<>();

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (231)

medium

The comment // Collect exported packages was removed. This comment clearly explained the intent of the subsequent lines, which is to gather exported packages from the bundle. Restoring it would enhance the readability of this section.

                        // Collect exported packages
                        BundleDescription bundleDesc = model.getBundleDescription();

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (242)

medium

The comment // Second pass: build dependency graph was removed. This comment was important for understanding the overall structure of the buildDependencyGraph method, clearly marking the transition to the second phase of graph construction. Reinstating it would improve code clarity.

            // Second pass: build dependency graph
            for (Map.Entry<String, IPluginModelBase> entry : workspaceModels.entrySet()) {

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (248)

medium

The comment // Get Require-Bundle dependencies was removed. This comment clearly indicated the section of code responsible for processing Require-Bundle dependencies, improving the readability of the buildDependencyGraph method.

                    // Get Require-Bundle dependencies
                    BundleSpecification[] requiredBundles = bundleDesc.getRequiredBundles();

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (257)

medium

The comment // Get Import-Package dependencies was removed. This comment was essential for understanding the logic behind processing Import-Package dependencies. Its absence makes the code harder to follow.

                    // Get Import-Package dependencies
                    ImportPackageSpecification[] importedPackages = bundleDesc.getImportPackages();

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (262)

medium

The comment // Only add if it's a workspace bundle and not self-import was removed. This comment provided crucial context for the conditional logic, explaining why certain dependencies are added. Its absence reduces the clarity of the code.

                            // Only add if it's a workspace bundle and not self-import
                            if (providingBundle != null && !providingBundle.equals(pluginId)) {

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (274)

medium

A blank line was removed before the loop in findAllCycles(). This blank line helped to visually separate the initialization of visited from the main loop, improving readability. Restoring it would make the method's structure clearer.

            visited = new HashSet<>();
            
            for (String plugin : dependencyGraph.keySet()) {

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (287)

medium

A blank line was removed after recursionStack.add(node). This blank line helped to visually separate the setup steps from the core logic of iterating through dependencies, improving readability. Restoring it would make the method's structure clearer.

            recursionStack.add(node);
            
            Set<DependencyEdge> dependencies = dependencyGraph.get(node);

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (296)

medium

The comment // Cycle detected was removed. This comment provided crucial context for understanding the conditional block where a cycle is identified. Reinstating it would improve the clarity of this complex part of the algorithm.

                    } else if (recursionStack.contains(dep)) {
                        // Cycle detected
                        CycleInfo cycle = extractCycle(node, dep, edge);

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (308-323)

medium

Numerous comments explaining the steps of path reconstruction, cycle list creation, and edge type population were removed from the extractCycle method. This method performs intricate logic to build the CycleInfo object, and these comments were highly valuable for understanding its internal workings. Their absence significantly impacts the readability and maintainability of this complex method.

            path.addFirst(current); // Start with the node where recursion found cycle
            // Reconstruct path from 'current' back to 'cycleStart'
            String node = current;
            while (!node.equals(cycleStart)) {
                node = parent.get(node);
                path.addFirst(node);
            }
            // Now 'path' is [cycleStart, ..., current]
            // Create cycle list for CycleInfo: [cycleStart, ..., current, cycleStart]
            List<String> cycleList = new ArrayList<>(path);
            cycleList.add(cycleStart); // Close the cycle
            CycleInfo cycleInfo = new CycleInfo(cycleList);
            // Populate edge types for the cycle
            // Edges from cycleStart to current
            for (int i = 0; i < path.size() - 1; i++) {
                String from = path.get(i);
                String to = path.get(i + 1);
                // The edge that leads to 'to' from 'from'
                DependencyEdge edge = parentEdge.get(to); 
                cycleInfo.addEdge(from, to, edge.type);
            }
            // The final edge from 'current' back to 'cycleStart'
            cycleInfo.addEdge(current, cycleStart, finalEdge.type);

com.vogella.ide.debugtools/src/com/vogella/ide/debugtools/handlers/DetectCyclicDependenciesHandler.java (337-347)

medium

Several comments and blank lines explaining the steps for normalizing a cycle (removing duplicate, finding minimum element, rotating) were removed from the normalizeCycle method. This method performs a non-trivial operation to ensure consistent cycle representation, and these comments were crucial for understanding its logic. Their absence significantly impacts the readability and maintainability of this method.

            List<String> temp = new ArrayList<>(cycle.subList(0, cycle.size() - 1));
            
            // Find the minimum element
            int minIndex = 0;
            for (int i = 1; i < temp.size(); i++) {
                if (temp.get(i).compareTo(temp.get(minIndex)) < 0) {
                    minIndex = i;
                }
            }
            
            // Rotate to start with minimum element
            List<String> normalized = new ArrayList<>();
            for (int i = 0; i < temp.size(); i++) {
                normalized.add(temp.get((minIndex + i) % temp.size()));
            }
            normalized.add(normalized.get(0)); // Add back the duplicate to complete the cycle
            
            return normalized;

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Maven configuration by moving the tycho.version property from pom.xml to a new .mvn/maven.config file. This centralizes the Tycho version and updates it, which is a good improvement for maintainability. My feedback includes suggestions to add missing newline characters at the end of the modified files, which is a standard convention.

<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>5.0.0</version>
<version>${tycho.version}</version>

Choose a reason for hiding this comment

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

medium

Using a property for the version is a good improvement. On a related note, this file is missing a final newline character. It's a good practice to add one to ensure compatibility with various tools that process text files.

Comment on lines 1 to 3
-T4
-Dtycho.localArtifacts=ignore
-Dtycho.version=5.0.1 No newline at end of file

Choose a reason for hiding this comment

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

medium

It's a good practice to end files with a newline character to ensure compatibility with various command-line tools. I've added one to the end of the file.

-T4
-Dtycho.localArtifacts=ignore
-Dtycho.version=5.0.1

@vogella vogella merged commit c0b290b into main Dec 9, 2025
1 check passed
@vogella vogella deleted the mavenconfig branch December 9, 2025 14:19
@vogella vogella restored the mavenconfig branch December 9, 2025 14:20
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