Catch with multiple exceptions not catching exceptions in obfuscated build

Viewed 550

I have used catch block with multiple exceptions , Which is working fine in unobfuscated build, But not catching exception in obfuscated build.

I am using proguard-maven-plugin

try {
  ...
} catch (ServletException | IOException e){
  ...
}

Is there any proguard rule i need to add for this?

Because its working fine When i write my code as

try {
  ...
} catch (ServletException e) {
  ...
} catch (IOException e) {
  ...
}
2 Answers

Multi catch exception can be used when there are chances of raising exceptions without any relation(parent-child), something like IOException and ArithmeticException and NullPointerException. But you can't use multi catch block with the exception like IOException and FileNotFoundException because IOException is the parent of FileNotFoundException.

Multi catch block is given in java7 just for programmer's convenience. It doesn't affect the execution time.

Related