Skip to content

Conversation

@yarosl4v
Copy link
Contributor

in progress

@ignorer ignorer self-assigned this Dec 20, 2016
Copy link
Collaborator

@ignorer ignorer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то я не увидел, чтобы пароль использовался где-то, кроме регистрации.

import org.springframework.context.annotation.Configuration;
import ru.mipt.java2016.homework.base.task1.Calculator;

/**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну хоть бы коммент удалил при копипасте :)

public class BillingDatabaseConfiguration {
@Bean
public DataSource billingDataSource(
@Value("jdbc:h2:mem:testdb") String jdbcUrl,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно создать в main/resources файл application.properties, в который положить вот это значение. То же касается и следующих двух строк, только там выставлены пустые значения по умолчанию.


// Update initial (username, password)
jdbcTemplate.execute("DELETE FROM billing.users WHERE username = 'username'");
jdbcTemplate.execute("INSERT INTO billing.users VALUES ('username', 'password')");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно было бы использовать MERGE

name = "world";
}
return "<html>" +
"<head><title>FediqApp</title></head>" +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Но ведь...

String username = authentication.getName();
double result = calculator.calculate(expression);

LOG.trace("Result: " + result);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше бы объединить это с предыдущим сообщением логгера, потому как если 100 пользователей одновременно захотят посчитать, то получится каша из сообщений, непонятно, какой результат к какому выражению относится.

String password = arguments[1];

LOG.trace(username);
LOG.trace(password);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ещё один пример неудачного логирования.

}

// Calculate the value of call function(a, b)
private double performBinaryFunction(String function, double a, double b) throws ParsingException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хм, а если я добавлю в список базовых функцию от 3 аргументов?

Copy link
Contributor Author

@yarosl4v yarosl4v Dec 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ignorer В условиях задания, пока не предусмотрены функции от 3 аргументов.

А если вдруг они и возникнут, то грамматика спокойно обобщается и на них. :)

.logout().disable()
.csrf().disable()
.authorizeRequests()
.antMatchers("/eval/**").authenticated()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему только eval? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants