From 0488e1b9370861b44a94b821be7c2b5d5983572e Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 2 Mar 2015 12:16:42 +0300 Subject: [PATCH] fixed decompiler tests --- .../java/decompiler/modules/decompiler/stats/Statement.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java index 885b5e2..186ca68 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2014 JetBrains s.r.o. + * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -879,7 +879,7 @@ public class Statement implements IMatchable { int node_type = matchNode.getType(); - if(node_type == MatchNode.MATCHNODE_STATEMENT) { + if (node_type == MatchNode.MATCHNODE_STATEMENT && !this.stats.isEmpty()) { String position = (String)matchNode.getRuleValue(MatchProperties.STATEMENT_POSITION); if(position != null) { if(position.matches("-?\\d+")) { @@ -888,7 +888,7 @@ public class Statement implements IMatchable { } else if(index < this.stats.size()) { // use 'index' parameter return this.stats.get(index); } - } else if(node_type == MatchNode.MATCHNODE_EXPRENT && this.exprents != null) { + } else if(node_type == MatchNode.MATCHNODE_EXPRENT && this.exprents != null && !this.exprents.isEmpty()) { String position = (String)matchNode.getRuleValue(MatchProperties.EXPRENT_POSITION); if(position != null) { if(position.matches("-?\\d+")) {