Applying suggestions from code review 2

This commit is contained in:
delvh 2020-06-14 16:11:46 +02:00
parent 4071487048
commit 7744d382b1
2 changed files with 5 additions and 4 deletions

View File

@ -52,7 +52,6 @@ public final class Startup extends Application {
public void start(Stage stage) throws Exception {
try {
// Load the configuration from client.properties first
logger.log(Level.INFO, "Envoy was started at " + new Date());
final Properties properties = new Properties();
properties.load(Startup.class.getClassLoader().getResourceAsStream("client.properties"));
config.load(properties);
@ -76,6 +75,8 @@ public final class Startup extends Application {
EnvoyLog.setFileLevelBarrier(config.getFileLevelBarrier());
EnvoyLog.setConsoleLevelBarrier(config.getConsoleLevelBarrier());
logger.log(Level.INFO, "Envoy was started at " + new Date());
// Initialize the local database
if (config.isIgnoreLocalDB()) {
localDB = new TransientLocalDB();

View File

@ -238,7 +238,7 @@ public final class ChatScene {
messageTextArea.positionCaret(MAX_MESSAGE_LENGTH);
messageTextArea.setScrollTop(Double.MAX_VALUE);
}
designRemainingCharsLabel();
updateRemainingCharsLabel();
}
/**
@ -246,7 +246,7 @@ public final class ChatScene {
*
* @since Envoy Client v0.1-beta
*/
private void designRemainingCharsLabel() {
private void updateRemainingCharsLabel() {
final int currentLength = messageTextArea.getText().length();
final int remainingLength = MAX_MESSAGE_LENGTH - currentLength;
remainingChars.setText(String.format("remaining chars: %d/%d", remainingLength, MAX_MESSAGE_LENGTH));
@ -286,6 +286,6 @@ public final class ChatScene {
// Clear text field and disable post button
messageTextArea.setText("");
postButton.setDisable(true);
designRemainingCharsLabel();
updateRemainingCharsLabel();
}
}