Skip to content
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
6 changes: 6 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
value="java.io.Serial, javafx.fxml.FXML"/>
</module>
</module>
<!-- Аналог oxlint no-console:error: любой System.out/System.err.print* роняет verify. -->
<module name="RegexpSingleline">
<property name="format" value="System\s*\.\s*(out|err)\s*\.\s*print\w*\s*\("/>
<property name="message" value="Логирование через System.out/System.err запрещено, используй java.util.logging.Logger"/>
<property name="severity" value="error"/>
</module>
<!-- Lombok @Getter и Jackson читают эти поля в обход исходников, Checkstyle их не видит: без фильтра UnusedPrivateField ложно падает на entities/filter/data и ServiceRegistry. -->
<module name="SuppressionSingleFilter">
<property name="checks" value="UnusedPrivateField"/>
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/DesktopApplicationClientJava/Program.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
Expand All @@ -25,6 +27,7 @@ public class Program extends Application {

private static final String ICON_BASE = "/images/icons/png/app-";
private static final List<Integer> ICON_SIZES = List.of(16, 32, 48, 64, 128, 256);
private static final Logger LOG = Logger.getLogger(Program.class.getName());

private final Session session = new Session();
private final ApiClient apiClient = new ApiClient(session);
Expand Down Expand Up @@ -80,7 +83,7 @@ private void loadIcons(Stage stage) {
stage.getIcons().add(new Image(in));
}
} catch (IOException e) {
System.err.println(e);
LOG.log(Level.WARNING, "Не удалось загрузить иконку приложения", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public void initialize() {
Role.USER.toString(), Role.MODER.toString(), Role.ADMIN.toString()));
// Установить значение по умолчанию (опционально)
rolesChoiceBox.setValue(Role.USER.toString());

System.out.println(rolesChoiceBox.getValue());
}

@FXML
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Глушит JUL в тестах: в CI видны только предупреждения и ошибки, INFO-шум не загрязняет логи.
.level=WARNING
java.util.logging.ConsoleHandler.level=WARNING
Loading