Skip to content

Instantly share code, notes, and snippets.

View KowalczykBartek's full-sized avatar

Bartek Kowalczyk KowalczykBartek

View GitHub Profile
public void rethrowException(String exceptionName)
throws FirstException, SecondException {
try {
// ...
}
catch (Exception e) {
throw e;
}
}
public void rethrowException(String exceptionName) throws Exception {
try {
if (exceptionName.equals("First")) {
throw new FirstException();
} else {
throw new SecondException();
}
} catch (Exception e) {
throw e;
catch (IOException|SQLException ex) {
logger.log(ex);
throw ex;
}
catch (IOException ex) {
logger.log(ex);
throw ex;
catch (SQLException ex) {
logger.log(ex);
throw ex;
}
catch (IOException|SQLException ex) {
logger.log(ex);
throw ex;
}
catch (IOException|SQLException ex) {
logger.log(ex);
throw ex;
}
catch (IOException|SQLException ex) {
logger.log(ex);
throw ex;
}
switch (dzienTygodnia) {
case "Poniedzialek":
System.out.println("Początek tygodnia");
break;
case "Wtorek":
case "Sroda":
case "Czwartek":
System.out.println("Jeszcze trochę !");
break;
case "Piatek":
try ( FileInputStream fin = new FileInputStream("jakisPlik.bin");
ObjectInputStream in = new ObjectInputStream(fin) ) {
//cosik
}
try ( ObjectInputStream in = new ObjectInputStream(new
FileInputStream("jakisPlik.bin")) ) {
//tutaj cosik
}