From a9d316f2b5c5ade099022386c9ca30c8c480f5af Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 28 Apr 1999 16:26:06 +0000 Subject: [PATCH] bug fix in declaration searching git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@693 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/CaseBlock.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/jode/jode/flow/CaseBlock.java b/jode/jode/flow/CaseBlock.java index dfc6bd7..b176261 100644 --- a/jode/jode/flow/CaseBlock.java +++ b/jode/jode/flow/CaseBlock.java @@ -102,15 +102,21 @@ public class CaseBlock extends StructuredBlock { if (!(block instanceof SequentialBlock)) { /* This was the last block on the first level. - * If we get here, we need no braces. + * Finally check if that is an declaring InstructionBlock. + */ + if (block instanceof InstructionBlock + && ((InstructionBlock)block).isDeclaration) + return true; + + + /* If we get here, we need no braces. */ return false; } - + StructuredBlock[] subBlocks = block.getSubBlocks(); if (subBlocks[0] instanceof InstructionBlock - && subBlocks[0].declare != null - && !subBlocks[0].declare.isEmpty()) { + && ((InstructionBlock)subBlocks[0]).isDeclaration) { /* An instruction block declares on the same level as * the surrounding SequentialBlock. */