Skip to content

Commit

Permalink
fix: fix thread blocking issue (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt authored Oct 1, 2023
1 parent a99d872 commit 20e8577
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ private static Optional<String> tryGetOriginalSourceCode(SourcePositionHolder el
}
}

private static Optional<String> getRelativeFilePath(SourcePositionHolder positionHolder, String rootPath) {
private static Optional<String> getRelativeFilePath(
SourcePositionHolder positionHolder, String rootPath) {
try {
File file = positionHolder.getPosition().getFile();
Path filePath = Paths.get(file.getAbsolutePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public class SpoonRefactor extends TransformationProcessor<CtType<?>> {
private Map<RuleId, Function<AnalyzerResult, AbstractRefactoring>> ruleParser;

Check warning on line 18 in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/spoon/SpoonRefactor.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Field may be 'final'

Field `ruleParser` may be 'final'
private List<AbstractRefactoring> refactors;

Check warning on line 19 in code-transformation/src/main/java/xyz/keksdose/spoon/code_solver/analyzer/spoon/SpoonRefactor.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Field may be 'final'

Field `refactors` may be 'final'

public SpoonRefactor(ChangeListener changeListener, Iterable<? extends AnalyzerResult> badSmells) {
public SpoonRefactor(
ChangeListener changeListener, Iterable<? extends AnalyzerResult> badSmells) {
super(changeListener);
ruleParser = new HashMap<>();
refactors = new ArrayList<>();
Expand Down
1 change: 0 additions & 1 deletion github-bot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dependencies {
implementation("io.quarkus:quarkus-keycloak-authorization")
implementation("io.quarkus:quarkus-micrometer-registry-prometheus")
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2'
implementation("io.quarkus:quarkus-opentelemetry")
implementation project(":application")
implementation project(":commons")
implementation "io.quarkiverse.loggingmanager:quarkus-logging-manager:3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import io.github.martinwitt.laughing_train.persistence.repository.ProjectRepository;
import io.github.martinwitt.laughing_train.summary.GetFixableBadSmells;
import io.github.martinwitt.spoon_analyzer.badsmells.SpoonRules;
import io.smallrye.common.annotation.RunOnVirtualThread;
import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import java.util.Arrays;
import java.util.List;
Expand All @@ -18,8 +16,6 @@
import org.eclipse.microprofile.graphql.Query;

@GraphQLApi
@RequestScoped
@RunOnVirtualThread
public class BadSmellGraphQL {

@Inject BadSmellRepository badSmellRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import io.github.martinwitt.laughing_train.persistence.repository.ProjectRepository;
import io.github.martinwitt.laughing_train.services.ProjectConfigService;
import io.quarkus.security.Authenticated;
import io.smallrye.common.annotation.RunOnVirtualThread;
import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import java.util.List;
import org.eclipse.microprofile.graphql.DefaultValue;
Expand All @@ -23,8 +21,6 @@
import org.eclipse.microprofile.graphql.Query;

@GraphQLApi
@RequestScoped
@RunOnVirtualThread
public class ProjectGraphQL {

private static final FluentLogger logger = FluentLogger.forEnclosingClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import io.github.martinwitt.laughing_train.persistence.repository.BadSmellRepository;
import io.github.martinwitt.laughing_train.services.RefactorService;
import io.quarkus.security.Authenticated;
import io.smallrye.common.annotation.RunOnVirtualThread;
import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Inject;
import java.util.Arrays;
import java.util.Collection;
Expand All @@ -22,8 +20,6 @@
import xyz.keksdose.spoon.code_solver.analyzer.qodana.QodanaRules;

@GraphQLApi
@RequestScoped
@RunOnVirtualThread
public class RefactorGraphQL {
private static final FluentLogger logger = FluentLogger.forEnclosingClass();

Expand Down

0 comments on commit 20e8577

Please sign in to comment.