Code cleanup.
diff --git a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/commands/CommentNodesFinder_matchingCommentNode_Test.java b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/commands/semicolon/CommentNodesFinder_matchingCommentNode_Test.java
similarity index 97%
rename from com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/commands/CommentNodesFinder_matchingCommentNode_Test.java
rename to com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/commands/semicolon/CommentNodesFinder_matchingCommentNode_Test.java
index 5beb1a3..7bd25bd 100644
--- a/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/commands/CommentNodesFinder_matchingCommentNode_Test.java
+++ b/com.google.eclipse.protobuf.ui.test/src/com/google/eclipse/protobuf/ui/commands/semicolon/CommentNodesFinder_matchingCommentNode_Test.java
@@ -6,23 +6,23 @@
*
* http://www.eclipse.org/legal/epl-v10.html
*/
-package com.google.eclipse.protobuf.ui.commands;
+package com.google.eclipse.protobuf.ui.commands.semicolon;
import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.*;
-import java.util.regex.Matcher;
+import com.google.eclipse.protobuf.junit.core.XtextRule;
+import com.google.eclipse.protobuf.protobuf.MessageField;
+import com.google.inject.Inject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.util.Pair;
import org.junit.*;
-import com.google.eclipse.protobuf.junit.core.XtextRule;
-import com.google.eclipse.protobuf.protobuf.MessageField;
-import com.google.inject.Inject;
+import java.util.regex.Matcher;
/**
* Tests for <code>{@link CommentNodesFinder#matchingCommentNode(EObject, String...)}</code>.
diff --git a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/commands/CommentNodesFinder.java b/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/commands/CommentNodesFinder.java
deleted file mode 100644
index eda2424..0000000
--- a/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/commands/CommentNodesFinder.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2011 Google Inc.
- *
- * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- *
- * http://www.eclipse.org/legal/epl-v10.html
- */
-package com.google.eclipse.protobuf.ui.commands;
-
-import static com.google.common.collect.Lists.newArrayList;
-import static com.google.eclipse.protobuf.util.SystemProperties.lineSeparator;
-import static java.util.regex.Pattern.CASE_INSENSITIVE;
-import static org.eclipse.xtext.nodemodel.util.NodeModelUtils.getNode;
-import static org.eclipse.xtext.util.Strings.isEmpty;
-import static org.eclipse.xtext.util.Tuples.pair;
-
-import java.util.List;
-import java.util.regex.*;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.nodemodel.*;
-import org.eclipse.xtext.util.*;
-
-import com.google.eclipse.protobuf.model.util.INodes;
-import com.google.inject.*;
-
-/**
- * @author alruiz@google.com (Alex Ruiz)
- */
-@Singleton class CommentNodesFinder {
- private static final String MATCH_ANYTHING = ".*";
-
- @Inject private INodes nodes;
- @Inject private final IResourceScopeCache cache = IResourceScopeCache.NullImpl.INSTANCE;
-
- Pair<INode, Matcher> matchingCommentNode(EObject target, String... patternsToMatch) {
- ICompositeNode node = getNode(target);
- for (INode currentNode : node.getAsTreeIterable()) {
- if (!nodes.isHiddenLeafNode(currentNode)) {
- continue;
- }
- if (!nodes.isComment(currentNode)) {
- continue;
- }
- String rawComment = ((ILeafNode) currentNode).getText();
- if (isEmpty(rawComment)) {
- continue;
- }
- String[] comment = rawComment.split(lineSeparator());
- for (String line : comment) {
- for (Pattern pattern : compile(patternsToMatch, target)) {
- Matcher matcher = pattern.matcher(line);
- if (matcher.matches()) { return pair(currentNode, matcher); }
- }
- }
- }
- return null;
- }
-
- private List<Pattern> compile(String[] patterns, EObject target) {
- List<Pattern> compiled = newArrayList();
- for (final String s : patterns) {
- Pattern p = cache.get(s, target.eResource(), new Provider<Pattern>() {
- @Override public Pattern get() {
- return Pattern.compile(MATCH_ANYTHING + s + MATCH_ANYTHING, CASE_INSENSITIVE);
- }
- });
- compiled.add(p);
- }
- return compiled;
- }
-}