Merge branch 'assert_throw_in_else_clause' of https://github.com/droid666/intellij...
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Fri, 14 Oct 2016 15:23:25 +0000 (18:23 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Fri, 14 Oct 2016 15:23:25 +0000 (18:23 +0300)
1  2 
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/AssertProcessor.java

index 2ccbe3d335be81826ec79f46835cf1ff93ceafcf,18f1ca98a6ffb5bde623add55963219d47c03ec2..e7942eba6b3e476aa538dc1a590bad5e579c9f81
@@@ -169,14 -179,21 +179,21 @@@ public class AssertProcessor 
        return false;
      }
  
 -    List<Exprent> lstParams = new ArrayList<Exprent>();
 +    List<Exprent> lstParams = new ArrayList<>();
  
      Exprent ascond = null, retcond = null;
-     if (exprres[0] != null) {
-       ascond = new FunctionExprent(FunctionExprent.FUNCTION_BOOL_NOT, (Exprent)exprres[0], throwError.bytecode);
-       retcond = SecondaryFunctionsHelper.propagateBoolNot(ascond);
+     if (throwInIf) {
+       if (exprres[0] != null) {
+         ascond = new FunctionExprent(FunctionExprent.FUNCTION_BOOL_NOT, (Exprent)exprres[0], throwError.bytecode);
+         retcond = SecondaryFunctionsHelper.propagateBoolNot(ascond);
+       }
+     }
+     else {
+         ascond =  (Exprent) exprres[0];
+         retcond = ascond;
      }
  
      lstParams.add(retcond == null ? ascond : retcond);
      if (!throwError.getLstParameters().isEmpty()) {
        lstParams.add(throwError.getLstParameters().get(0));