mirror of
https://github.com/Example-uPagge/debugger.git
synced 2024-06-14 11:22:32 +03:00
Небольшой рефакторинг
This commit is contained in:
parent
2bd2859412
commit
e6ca7579e1
@ -1,6 +1,6 @@
|
|||||||
package dev.struchkov.example.debugger.box;
|
package dev.struchkov.example.debugger.box;
|
||||||
|
|
||||||
public class SurpriseBox {
|
public final class SurpriseBox {
|
||||||
|
|
||||||
public static void surpriseOne(int i) {
|
public static void surpriseOne(int i) {
|
||||||
if (i == 896) {
|
if (i == 896) {
|
||||||
|
@ -6,7 +6,9 @@ public class ExampleOne {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final ExampleOne exampleOne = new ExampleOne();
|
final ExampleOne exampleOne = new ExampleOne();
|
||||||
|
System.out.println("\n\nПрограмма запущена");
|
||||||
exampleOne.demo();
|
exampleOne.demo();
|
||||||
|
System.out.println("Программа выполнена");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void demo() {
|
private void demo() {
|
||||||
|
@ -7,12 +7,12 @@ public class FooService {
|
|||||||
|
|
||||||
public void example() {
|
public void example() {
|
||||||
for (int i = 0; i < 1000; i++) {
|
for (int i = 0; i < 1000; i++) {
|
||||||
testMethod(i);
|
noSurpriseMethod(i);
|
||||||
SurpriseBox.surpriseOne(i);
|
SurpriseBox.surpriseOne(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void testMethod(int i) {
|
private void noSurpriseMethod(int i) {
|
||||||
if (i == 100) {
|
if (i == 100) {
|
||||||
try {
|
try {
|
||||||
throw new SurpriseException("Упс");
|
throw new SurpriseException("Упс");
|
||||||
|
Loading…
Reference in New Issue
Block a user