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

Fix PMD and checkstyle violations #469

Merged
merged 1 commit into from
Sep 14, 2020
Merged
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
3 changes: 1 addition & 2 deletions .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:
with:
version: '11'
- name: mvn package
if: contains( github.event.pull_request.labels.*.name, 'depends-on/camel/master') == 'false' && contains( github.event.pull_request.labels.*.name, 'depends-on/quarkus/master') == 'false'
run: |
./mvnw -fae -B -ntp clean verify \
./mvnw -ntp clean verify \
-Dcheckstyle.failOnViolation=true \
-DskipTests \
-Psourcecheck,license
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.camel.k.main.ApplicationRuntime;
import org.junit.jupiter.api.function.ThrowingConsumer;

public class RuntimeTestSupport {
public final class RuntimeTestSupport {
private RuntimeTestSupport() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.Locale;
import java.util.stream.Collectors;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.json.Json;
Expand All @@ -40,7 +41,7 @@
@Path("/test")
@ApplicationScoped
public class Application {
public static String TEMPLATE_ID = "to-upper";
public static final String TEMPLATE_ID = "to-upper";

@Inject
CamelContext context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.camel.k.quarkus.kamelet.deployment;

import java.util.Locale;

import javax.ws.rs.core.MediaType;

import io.quarkus.test.junit.QuarkusTest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static SourceLoader load(Runtime runtime, Source source) {
final SourceLoader loader = RuntimeSupport.loaderFor(runtime.getCamelContext(), source);
final List<SourceLoader.Interceptor> interceptors = source.getType() == SourceType.source
? sourceInterceptors(runtime, source)
: templateInterceptors(runtime, source);
: templateInterceptors(source);

try {
for (SourceLoader.Interceptor interceptor: interceptors) {
Expand Down Expand Up @@ -118,7 +118,7 @@ private static List<SourceLoader.Interceptor> sourceInterceptors(Runtime runtime
return RuntimeSupport.loadInterceptors(runtime.getCamelContext(), source);
}

private static List<SourceLoader.Interceptor> templateInterceptors(Runtime runtime, Source source) {
private static List<SourceLoader.Interceptor> templateInterceptors(Source source) {
if (!source.getInterceptors().isEmpty()) {
LOGGER.warn("Interceptors associated to the route template {} will be ignored", source.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
"extendsScheme": "",
"syntax": "kamelet:templateId\/routeId",
"async": false,
"api": false,
"apiPropertyQualifier": "",
"consumerOnly": false,
"producerOnly": false,
"lenientProperties": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
import org.slf4j.LoggerFactory;

public final class Kamelet {
private static final Logger LOGGER = LoggerFactory.getLogger(Kamelet.class);

public static final String SCHEME = "kamelet";
public static final String PROPERTIES_PREFIX = "camel.kamelet.";
public static final String SCHEME = "kamelet";

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

private Kamelet() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public class KameletEndpoint extends DefaultEndpoint {

private final Map<String, Object> kameletProperties;
private final String kameletUri;
private Producer producer;
private Consumer consumer;

public KameletEndpoint(
String uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
"extendsScheme": "",
"syntax": "knative:type\/name",
"async": false,
"api": false,
"apiPropertyQualifier": "",
"consumerOnly": false,
"producerOnly": false,
"lenientProperties": false
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@
</sourceDirectories>
<headerLocation>header-java.txt</headerLocation>
<includes>**/*.java,**/*.groovy,**/*.scala,**/*.properties,**/*.xml,**/*.xsd</includes>
<excludes>**/MyRoutes*.java,**/routes*.java,**/verify.groovy</excludes>
<excludes>**/MyRoutes*.java,**/routes*.java,**/verify.groovy,**/MyRouteTemplate*.java</excludes>
</configuration>
<goals>
<goal>checkstyle</goal>
Expand Down