From 53ad2b920ec63b1d5900357e9d4725f74031daa9 Mon Sep 17 00:00:00 2001 From: Stiver Date: Wed, 13 Aug 2014 22:04:51 +0200 Subject: [PATCH] Fixed 'IDEA-128593: Wrong order of switch cases' --- .../decompiler/stats/SwitchStatement.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/de/fernflower/modules/decompiler/stats/SwitchStatement.java b/src/de/fernflower/modules/decompiler/stats/SwitchStatement.java index 21fdfcf..f3d2231 100644 --- a/src/de/fernflower/modules/decompiler/stats/SwitchStatement.java +++ b/src/de/fernflower/modules/decompiler/stats/SwitchStatement.java @@ -266,15 +266,20 @@ public class SwitchStatement extends Statement { setPreds.remove(first); if(!setPreds.isEmpty()) { - Statement pred = setPreds.iterator().next(); // at most one predecessor node besides the head - for(int j=index+1;j index) { + nodes.remove(index); + edges.remove(index); + index--; + } else { + nodes.remove(index + 1); + edges.remove(index + 1); + } break; } }