From 3ce0d9610605394b21012414169da757b093b4a0 Mon Sep 17 00:00:00 2001 From: Sebastian Zarnekow Date: Thu, 15 Mar 2012 15:59:45 +0100 Subject: [PATCH] [xtext] Minor: Code cleanup in MultilineCommentDocumentationProvider --- .../impl/MultiLineCommentDocumentationProvider.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/documentation/impl/MultiLineCommentDocumentationProvider.java b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/documentation/impl/MultiLineCommentDocumentationProvider.java index 6f9c61087..7f88ab4df 100644 --- a/plugins/org.eclipse.xtext/src/org/eclipse/xtext/documentation/impl/MultiLineCommentDocumentationProvider.java +++ b/plugins/org.eclipse.xtext/src/org/eclipse/xtext/documentation/impl/MultiLineCommentDocumentationProvider.java @@ -82,14 +82,14 @@ public class MultiLineCommentDocumentationProvider implements IEObjectDocumentat List result = Collections.emptyList(); if (node != null) { // get the last multi line comment before a non hidden leaf node - for (INode abstractNode : node.getLeafNodes()) { - if (abstractNode instanceof ILeafNode && !((ILeafNode) abstractNode).isHidden()) + for (ILeafNode leafNode : node.getLeafNodes()) { + if (!leafNode.isHidden()) break; - if (abstractNode instanceof ILeafNode && abstractNode.getGrammarElement() instanceof TerminalRule - && ruleName.equalsIgnoreCase(((TerminalRule) abstractNode.getGrammarElement()).getName())) { - String comment = ((ILeafNode) abstractNode).getText(); + if (leafNode.getGrammarElement() instanceof TerminalRule + && ruleName.equalsIgnoreCase(((TerminalRule) leafNode.getGrammarElement()).getName())) { + String comment = leafNode.getText(); if (comment.matches("(?s)" + startTag + ".*")) { - result = Collections.singletonList(abstractNode); + result = Collections.singletonList(leafNode); } } }