Skip to content

Commit

Permalink
fix some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdolatabadi committed Jul 24, 2020
1 parent 016eb28 commit 59c235a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/example/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import javafx.scene.control.*;
import javafx.scene.control.cell.PropertyValueFactory;

import java.io.EOFException;
import java.io.IOException;
import java.net.URL;
import java.util.*;
Expand Down Expand Up @@ -73,7 +74,9 @@ private ObservableList<Model.CartItem> getInitialTableData() {
App.dataOutputStream.writeUTF(App.token + " " + name);
App.dataOutputStream.flush();
String message = App.dataInputStream.readUTF();
} catch (IOException e) {
} catch (EOFException e){
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}

Expand All @@ -85,7 +88,9 @@ private ObservableList<Model.CartItem> getInitialTableData() {
if ((obj = App.inObject.readObject()) != null) {
product = ((Model.Product) obj);
}
} catch (IOException e) {
}catch (EOFException e){
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
Expand Down
16 changes: 4 additions & 12 deletions src/main/java/org/example/UsersManaging.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
// App.sendObjectToServer(Manager.class);
try {
users1 = (String[]) App.inObject.readObject();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
System.out.println(users1);
Expand All @@ -69,9 +67,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
Model.Account account = null;
try {
account = (Model.Account) App.inObject.readObject();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
users.add(account);
Expand All @@ -83,9 +79,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
// App.sendObjectToServer(Customer.class);
try {
users2 = (String[]) App.inObject.readObject();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
if (users2 != null && users2.length != 0) {
Expand All @@ -96,9 +90,7 @@ public void initialize(URL url, ResourceBundle resourceBundle) {
Model.Account account = null;
try {
account = (Model.Account) App.inObject.readObject();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
users.add(account);
Expand Down

0 comments on commit 59c235a

Please sign in to comment.