mirror of
https://github.com/Example-uPagge/debugger.git
synced 2024-06-14 11:22:32 +03:00
Добавил примеры для дебага
This commit is contained in:
@@ -3,16 +3,11 @@ package dev.struchkov.example.debugger.four;
|
|||||||
public class ExampleFour {
|
public class ExampleFour {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final ThirdService thirdService = new ThirdService();
|
final ThreadExample one = new ThreadExample("Первый");
|
||||||
final SecondService secondService = new SecondService(thirdService);
|
final ThreadExample two = new ThreadExample("Второй");
|
||||||
final FirstService firstService = new FirstService(secondService);
|
|
||||||
|
|
||||||
final Entity entity = new Entity("Dasha");
|
new Thread(one).start();
|
||||||
firstService.processing(entity);
|
new Thread(two).start();
|
||||||
|
|
||||||
System.out.println();
|
|
||||||
System.out.println(entity);
|
|
||||||
System.out.println();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package dev.struchkov.example.debugger.three;
|
package dev.struchkov.example.debugger.four;
|
||||||
|
|
||||||
public class ThreadExample implements Runnable {
|
public class ThreadExample implements Runnable {
|
||||||
|
|
||||||
@@ -5,8 +5,8 @@ public class ExampleOne {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
final PersonService personService = new PersonService();
|
final PersonService personService = new PersonService();
|
||||||
|
|
||||||
demoOne(personService);
|
// demoOne(personService);
|
||||||
// demoTwo(personService);
|
demoTwo(personService);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void demoOne(PersonService personService) {
|
private static void demoOne(PersonService personService) {
|
||||||
@@ -15,6 +15,10 @@ public class ExampleOne {
|
|||||||
personService.showAllPerson();
|
personService.showAllPerson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getIvanovName() {
|
||||||
|
return "Иванов";
|
||||||
|
}
|
||||||
|
|
||||||
private static void demoTwo(PersonService personService) {
|
private static void demoTwo(PersonService personService) {
|
||||||
personService.showAllPerson();
|
personService.showAllPerson();
|
||||||
personService.correctDeleteAllByLastName("Скворцова");
|
personService.correctDeleteAllByLastName("Скворцова");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package dev.struchkov.example.debugger.four;
|
package dev.struchkov.example.debugger.three;
|
||||||
|
|
||||||
public class Entity {
|
public class Entity {
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package dev.struchkov.example.debugger.three;
|
||||||
|
|
||||||
|
public class ExampleThree {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
final ThirdService thirdService = new ThirdService();
|
||||||
|
final SecondService secondService = new SecondService(thirdService);
|
||||||
|
final FirstService firstService = new FirstService(secondService);
|
||||||
|
|
||||||
|
final Entity entity = new Entity("Dasha");
|
||||||
|
firstService.processing(entity);
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
System.out.println(entity);
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package dev.struchkov.example.debugger.four;
|
package dev.struchkov.example.debugger.three;
|
||||||
|
|
||||||
import dev.struchkov.example.debugger.box.SurpriseException;
|
import dev.struchkov.example.debugger.box.SurpriseException;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package dev.struchkov.example.debugger.four;
|
package dev.struchkov.example.debugger.three;
|
||||||
|
|
||||||
public class SecondService {
|
public class SecondService {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package dev.struchkov.example.debugger.four;
|
package dev.struchkov.example.debugger.three;
|
||||||
|
|
||||||
public class ThirdService {
|
public class ThirdService {
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package dev.struchkov.example.debugger.three;
|
|
||||||
|
|
||||||
public class TreadMain {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
final ThreadExample one = new ThreadExample("Первый");
|
|
||||||
final ThreadExample two = new ThreadExample("Второй");
|
|
||||||
|
|
||||||
new Thread(one).start();
|
|
||||||
new Thread(two).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package dev.struchkov.example.debugger.two;
|
||||||
|
|
||||||
|
public class ExampleTwo {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
final FooService fooService = new FooService();
|
||||||
|
fooService.example();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ package dev.struchkov.example.debugger.two;
|
|||||||
|
|
||||||
import dev.struchkov.example.debugger.box.SurpriseBox;
|
import dev.struchkov.example.debugger.box.SurpriseBox;
|
||||||
|
|
||||||
public class ForExample {
|
public class FooService {
|
||||||
|
|
||||||
public void example() {
|
public void example() {
|
||||||
for (int i = 0; i < 1000; i++) {
|
for (int i = 0; i < 1000; i++) {
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package dev.struchkov.example.debugger.two;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
final ForExample forExample = new ForExample();
|
|
||||||
forExample.example();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user