aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java')
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java
index ca9a5b363..6aa0ad823 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java
@@ -23,12 +23,12 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
-import com.google.common.collect.ImmutableMap;
import com.puppycrawl.tools.checkstyle.grammars.CommentListener;
import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
@@ -165,7 +165,7 @@ public final class FileContents implements CommentListener {
* @deprecated Use {@link #getSingleLineComments()} instead.
*/
@Deprecated
- public ImmutableMap<Integer, TextBlock> getCppComments() {
+ public Map<Integer, TextBlock> getCppComments() {
return getSingleLineComments();
}
@@ -174,8 +174,8 @@ public final class FileContents implements CommentListener {
* the value is the comment {@link TextBlock} at the line.
* @return the Map of comments
*/
- public ImmutableMap<Integer, TextBlock> getSingleLineComments() {
- return ImmutableMap.copyOf(cppComments);
+ public Map<Integer, TextBlock> getSingleLineComments() {
+ return Collections.unmodifiableMap(cppComments);
}
/**
@@ -202,7 +202,7 @@ public final class FileContents implements CommentListener {
*/
// -@cs[AbbreviationAsWordInName] Can't change yet since class is API.
@Deprecated
- public ImmutableMap<Integer, List<TextBlock>> getCComments() {
+ public Map<Integer, List<TextBlock>> getCComments() {
return getBlockComments();
}
@@ -212,8 +212,8 @@ public final class FileContents implements CommentListener {
* that start at that line.
* @return the map of comments
*/
- public ImmutableMap<Integer, List<TextBlock>> getBlockComments() {
- return ImmutableMap.copyOf(clangComments);
+ public Map<Integer, List<TextBlock>> getBlockComments() {
+ return Collections.unmodifiableMap(clangComments);
}
/**