Add EmptyLineSeparator Checkstyle rule
* Support "blank lines around" via `spring-framework.xml` IDEA config * Fix all the Checkstyle violations
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -57,7 +57,6 @@ public abstract class AbstractScriptExecutingMessageProcessor<T>
|
||||
this.scriptVariableGenerator = scriptVariableGenerator;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,7 +36,6 @@ public class DefaultScriptVariableGenerator implements ScriptVariableGenerator {
|
||||
|
||||
private final Map<String, Object> variableMap;
|
||||
|
||||
|
||||
public DefaultScriptVariableGenerator() {
|
||||
this.variableMap = Collections.<String, Object>emptyMap();
|
||||
}
|
||||
@@ -45,7 +44,6 @@ public class DefaultScriptVariableGenerator implements ScriptVariableGenerator {
|
||||
this.variableMap = variableMap;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> generateScriptVariables(Message<?> message) {
|
||||
Map<String, Object> scriptVariables = new HashMap<String, Object>();
|
||||
// Add Message content
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,7 +43,6 @@ public class RefreshableResourceScriptSource implements ScriptSource {
|
||||
|
||||
private volatile String script;
|
||||
|
||||
|
||||
public RefreshableResourceScriptSource(Resource resource, long refreshDelay) {
|
||||
this.refreshDelay = refreshDelay;
|
||||
this.source = new ResourceScriptSource(resource);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013-2019 the original author or authors.
|
||||
* Copyright 2013-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,4 +44,5 @@ public class ScriptExecutingMessageSource extends AbstractMessageSource<Object>
|
||||
protected Object doReceive() {
|
||||
return this.scriptMessageProcessor.processMessage(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,8 +30,8 @@ public class ScriptingException extends MessagingException {
|
||||
super(description);
|
||||
}
|
||||
|
||||
|
||||
public ScriptingException(String description, Throwable cause) {
|
||||
super(description, cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
* Copyright 2016-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -99,7 +99,6 @@ class DslScriptExecutingMessageProcessor
|
||||
this.script = this.applicationContext.getResource(this.location);
|
||||
}
|
||||
|
||||
|
||||
if (!StringUtils.hasText(this.lang)) {
|
||||
String scriptFilename = this.script.getFilename();
|
||||
Assert.hasText(scriptFilename,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
* Copyright 2016-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -125,7 +125,6 @@ public class ScriptSpec extends MessageProcessorSpec<ScriptSpec> {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected MessageProcessor<?> doGet() {
|
||||
if (this.variableGenerator == null) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -57,11 +57,14 @@ public class PythonScriptExecutor extends AbstractScriptExecutor {
|
||||
}
|
||||
|
||||
public static class PythonVariableParser {
|
||||
|
||||
public static String parseReturnVariable(String script) {
|
||||
String[] lines = script.trim().split("\n");
|
||||
String lastLine = lines[lines.length - 1];
|
||||
String[] tokens = lastLine.split("=");
|
||||
return tokens[0].trim();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,7 +42,6 @@ public class ScriptExecutingMessageProcessor extends AbstractScriptExecutingMess
|
||||
|
||||
private final ScriptSource scriptSource;
|
||||
|
||||
|
||||
/**
|
||||
* Create a processor for the {@link ScriptSource} using the provided
|
||||
* {@link ScriptExecutor} using the DefaultScriptVariableGenerator
|
||||
@@ -83,7 +82,6 @@ public class ScriptExecutingMessageProcessor extends AbstractScriptExecutingMess
|
||||
this(scriptSource, new DefaultScriptVariableGenerator(variables), scriptExecutor);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ScriptSource getScriptSource(Message<?> message) {
|
||||
return this.scriptSource;
|
||||
|
||||
Reference in New Issue
Block a user