Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
Expand All @@ -22,6 +23,7 @@
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
Expand All @@ -34,5 +36,22 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1764471104955</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
4 changes: 3 additions & 1 deletion .settings/org.eclipse.jdt.apt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
org.eclipse.jdt.apt.aptEnabled=true
org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations
org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations
1 change: 1 addition & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=enabled
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
38 changes: 38 additions & 0 deletions designite-output/ArchitectureSmells.csv
Copy link
Member

Choose a reason for hiding this comment

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

this has nothing to do in the codebase

Large diffs are not rendered by default.

187 changes: 187 additions & 0 deletions designite-output/DesignSmells.csv

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions designite-output/DesigniteLog29112025_2120.txt
Copy link
Member

Choose a reason for hiding this comment

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

this has nothing to do in the codebase

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
29-11-2025 21:20:36: Detecting code smells...
29-11-2025 21:20:36: Detecting cyclic dependency...
29-11-2025 21:20:36: Detecting architecture smells...
29-11-2025 21:20:37: Exporting analysis results...
29-11-2025 21:20:45: Done.
Total time (sec): 17
1,376 changes: 1,376 additions & 0 deletions designite-output/ImplementationSmells.csv
Copy link
Member

Choose a reason for hiding this comment

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

this has nothing to do in the codebase

Large diffs are not rendered by default.

1,430 changes: 1,430 additions & 0 deletions designite-output/MethodMetrics.csv
Copy link
Member

Choose a reason for hiding this comment

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

this has nothing to do in the codebase

Large diffs are not rendered by default.

202 changes: 202 additions & 0 deletions designite-output/TestSmells.csv
Copy link
Member

Choose a reason for hiding this comment

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

this has nothing to do in the codebase

Large diffs are not rendered by default.

196 changes: 196 additions & 0 deletions designite-output/TestabilitySmells.csv
Copy link
Member

Choose a reason for hiding this comment

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

this has nothing to do in the codebase

Large diffs are not rendered by default.

291 changes: 291 additions & 0 deletions designite-output/TypeMetrics.csv
Copy link
Member

Choose a reason for hiding this comment

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

this has nothing to do in the codebase

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package com.github.cameltooling.lsp.internal;

import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import org.apache.camel.catalog.DefaultCamelCatalog;
import org.apache.camel.catalog.RuntimeProvider;
import org.apache.camel.catalog.maven.MavenVersionManager;
import com.github.cameltooling.lsp.internal.catalog.runtimeprovider.CamelRuntimeProvider;
import com.github.cameltooling.lsp.internal.settings.JSONUtility;
import com.google.gson.Gson;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CamelCatalogService {

private static final Logger LOGGER = LoggerFactory.getLogger(CamelCatalogService.class);

public CompletableFuture<org.apache.camel.catalog.CamelCatalog> updateCatalog(String camelVersion, String camelCatalogRuntimeProvider, List<Map<?, ?>> extraComponents) {
return CompletableFuture.supplyAsync(() -> {
DefaultCamelCatalog catalog = new DefaultCamelCatalog(true);
updateCatalogVersion(camelVersion, catalog);
updateCatalogRuntimeProvider(camelCatalogRuntimeProvider, catalog);
updateCatalogExtraComponents(extraComponents, catalog);
return catalog;
});
}

private void updateCatalogVersion(String camelVersion, DefaultCamelCatalog catalog) {
if (camelVersion != null && !camelVersion.isEmpty()) {
MavenVersionManager versionManager = new MavenVersionManager();
if (camelVersion.contains("redhat")) {
versionManager.addMavenRepository("central", "https://repo1.maven.org/maven2/");
versionManager.addMavenRepository("maven.redhat.ga", "https://maven.repository.redhat.com/ga/");
}
catalog.setVersionManager(versionManager);
if (!catalog.loadVersion(camelVersion)) {
LOGGER.warn("Cannot load Camel catalog with version {}", camelVersion);
}
}
}

private void updateCatalogRuntimeProvider(String camelCatalogRuntimeProvider, DefaultCamelCatalog catalog) {
if(camelCatalogRuntimeProvider != null && !camelCatalogRuntimeProvider.isEmpty()) {
RuntimeProvider runtimeProvider = CamelRuntimeProvider.getProvider(camelCatalogRuntimeProvider);
if(runtimeProvider != null) {
catalog.setRuntimeProvider(runtimeProvider);
}
}
}

private void updateCatalogExtraComponents(List<Map<?, ?>> extraComponents, DefaultCamelCatalog catalog) {
if (extraComponents != null) {
for (Map<?,?> extraComponent : extraComponents) {
JSONUtility jsonUtility = new JSONUtility();
Map<?,?> extraComponentTopLevel = jsonUtility.toModel(extraComponent, Map.class);
Map<?,?> componentAttributes = jsonUtility.toModel(extraComponentTopLevel.get("component"), Map.class);
String name = (String) componentAttributes.get("scheme");
String className = (String) componentAttributes.get("javaType");
catalog.addComponent(name, className, new Gson().toJson(extraComponent));
}
}
}
}
Loading