aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinesh Bolkensteyn <dinesh@dinsoft.net>2011-10-20 22:10:22 +0200
committerDinesh Bolkensteyn <dinesh@dinsoft.net>2011-10-20 22:10:22 +0200
commit8a32bef17fb6fd98e0fe765e8b66a83e7cfa195a (patch)
treec0cf4accd550e2dbbeab8049230fe7fa9d970d04
parente1ecfa7d65c33df5ee054e57e2b5d696da038154 (diff)
downloadsonarqube-8a32bef17fb6fd98e0fe765e8b66a83e7cfa195a.tar.gz
sonarqube-8a32bef17fb6fd98e0fe765e8b66a83e7cfa195a.zip
SONAR-2923, SONAR-2632?: Fixed some side effects on other modules (again)
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java8
-rw-r--r--sonar-channel/src/main/java/org/sonar/channel/CodeReaderConfiguration.java20
-rw-r--r--sonar-markdown/src/main/java/org/sonar/markdown/Markdown.java11
3 files changed, 30 insertions, 9 deletions
diff --git a/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java b/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java
index 5a4e1a668e0..8f42fa7979b 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/CodeBuffer.java
@@ -23,7 +23,6 @@ import java.io.FilterReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
-import java.nio.CharBuffer;
import org.apache.commons.io.IOUtils;
@@ -136,6 +135,13 @@ public class CodeBuffer implements CharSequence {
}
/**
+ * Do not use in new code. Used to close the stream
+ */
+ @Deprecated
+ public final void close() {
+ }
+
+ /**
* @return the current line of the cursor
*/
public final int getLinePosition() {
diff --git a/sonar-channel/src/main/java/org/sonar/channel/CodeReaderConfiguration.java b/sonar-channel/src/main/java/org/sonar/channel/CodeReaderConfiguration.java
index 7347074b01d..8964ab2a046 100644
--- a/sonar-channel/src/main/java/org/sonar/channel/CodeReaderConfiguration.java
+++ b/sonar-channel/src/main/java/org/sonar/channel/CodeReaderConfiguration.java
@@ -35,6 +35,26 @@ public class CodeReaderConfiguration {
private List<CodeReaderFilter<?>> codeReaderFilters = new ArrayList<CodeReaderFilter<?>>();
/**
+ * Do not use in new code. Used to get the buffer capacity
+ *
+ * @return the constant Integer.MAX_VALUE
+ */
+ @Deprecated
+ public int getBufferCapacity() {
+ return Integer.MAX_VALUE;
+ }
+
+ /**
+ * Do not use in new code. Used to set the buffer capacity. Now has no effect
+ *
+ * @param bufferCapacity
+ * the bufferCapacity to set
+ */
+ @Deprecated
+ public void setBufferCapacity(int bufferCapacity) {
+ }
+
+ /**
* @return the tabWidth
*/
public int getTabWidth() {
diff --git a/sonar-markdown/src/main/java/org/sonar/markdown/Markdown.java b/sonar-markdown/src/main/java/org/sonar/markdown/Markdown.java
index f727d748e60..2d0991f5f60 100644
--- a/sonar-markdown/src/main/java/org/sonar/markdown/Markdown.java
+++ b/sonar-markdown/src/main/java/org/sonar/markdown/Markdown.java
@@ -43,14 +43,9 @@ public final class Markdown {
private String convert(String input) {
CodeReader reader = new CodeReader(input);
- try {
- MarkdownOutput output = new MarkdownOutput();
- dispatcher.consume(reader, output);
- return output.toString();
-
- } finally {
- reader.close();
- }
+ MarkdownOutput output = new MarkdownOutput();
+ dispatcher.consume(reader, output);
+ return output.toString();
}
public static String convertToHtml(String input) {