You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2020/04/21 02:56:51 UTC
[james-project] 15/19: [Refactoring] simplify
ProtocolConfigurationImpl by removing a lot of impossible states
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit be647b54535609e409a185566b538ded56821372
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Mon Apr 20 09:54:03 2020 +0200
[Refactoring] simplify ProtocolConfigurationImpl by removing a lot of impossible states
---
.../james/protocols/api/ProtocolConfigurationImpl.java | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
index 6e7f2bb..7d64464 100644
--- a/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
+++ b/protocols/api/src/main/java/org/apache/james/protocols/api/ProtocolConfigurationImpl.java
@@ -29,12 +29,11 @@ import java.net.UnknownHostException;
* Be aware that set and get operations are not thread-safe
*/
public class ProtocolConfigurationImpl implements ProtocolConfiguration {
-
- private String greeting;
- private String softwareName = "JAMES Protocols Server";
- private String helloName = null;
+
private static final String DEFAULT_HELLO_NAME;
-
+
+ private final String softwareName;
+
static {
String hName;
try {
@@ -46,6 +45,7 @@ public class ProtocolConfigurationImpl implements ProtocolConfiguration {
}
private ProtocolConfigurationImpl() {
+ this("JAMES Protocols Server");
}
protected ProtocolConfigurationImpl(String softwareName) {
@@ -54,15 +54,12 @@ public class ProtocolConfigurationImpl implements ProtocolConfiguration {
@Override
public String getHelloName() {
- if (helloName == null) {
- return DEFAULT_HELLO_NAME;
- }
- return helloName;
+ return DEFAULT_HELLO_NAME;
}
@Override
public String getGreeting() {
- return greeting;
+ return null;
}
@Override
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org