Небольшой рефакторинг

This commit is contained in:
Struchkov Mark 2022-07-23 11:34:30 +03:00
parent 2bd2859412
commit e6ca7579e1
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
package dev.struchkov.example.debugger.box;
public class SurpriseBox {
public final class SurpriseBox {
public static void surpriseOne(int i) {
if (i == 896) {

View File

@ -6,7 +6,9 @@ public class ExampleOne {
public static void main(String[] args) {
final ExampleOne exampleOne = new ExampleOne();
System.out.println("\n\рограмма запущена");
exampleOne.demo();
System.out.println("Программа выполнена");
}
private void demo() {

View File

@ -7,12 +7,12 @@ public class FooService {
public void example() {
for (int i = 0; i < 1000; i++) {
testMethod(i);
noSurpriseMethod(i);
SurpriseBox.surpriseOne(i);
}
}
private void testMethod(int i) {
private void noSurpriseMethod(int i) {
if (i == 100) {
try {
throw new SurpriseException("Упс");